Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7793239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:25:24+00:00 2026-06-01T22:25:24+00:00

This is my form: <!DOCTYPE html> <html> <head> </head> <body> <form action=register_ajax.php method=get> <input

  • 0

This is my form:

<!DOCTYPE html>
<html>
  <head>
  </head>
  <body>
    <form action="register_ajax.php" method="get">
    <input type="text" name="email">
    <input type="submit" value="test">
    </form>
  </body>
</html>

This is my php code:

<?php
    $dbc = mysqli_connect("localhost","root","*******","continental_tourism") OR die(mysqli_connect_error());
    $email = $_GET['email'];
    $query = "SELECT email FROM customer_info WHERE email = '$email' ";
    $r = mysqli_query($dbc, $query) OR die(mysqli_error($dbc));
    if($r)
        echo "Email address exists!";
    else
        echo "sss";
?>

If I enter a correct(Existing email on db) $r is true. But if I enter non existing email, then also $r is true. Why is that? Basically I want to detect the empty set. How can I do it?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T22:25:26+00:00Added an answer on June 1, 2026 at 10:25 pm

    $r will only be false if there was SQL error. Otherwise it will always return an object, even if no rows are returned by your SELECT statement.

    Use mysqli_num_rows() to count how many rows are returned. Zero means no one is using that email address.

    if(mysqli_num_rows($r))
        echo "Email address exists!";
    else
        echo "sss"; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this basic example: <!doctype HTML> <html> <head> <script src=jquery-1.4.2.min.js type=text/javascript></script> <script> $(document).ready(function(){
and with this form: (select * from mp3 aktif = '0') <form name=form method=post>
I have this form: <input type=checkbox value=First />First <input type=checkbox value=Second />Second <input type=checkbox
Here is my code: <!DOCTYPE html> <html> <head> <meta charset=utf-8> <meta name=viewport content=width=device-width, initial-scale=1>
I have a form that I want to validate looks like this: <!DOCTYPE html
I have this HTML form page: form1.html <!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd
This is all in a php file <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
Run this in IE 7,8 or 9. <!DOCTYPE html> <html> <head> <meta charset=utf-8> <title>IE
I have got a html like this: <!doctype html> <html manifest=> <head> <meta charset=utf-8
I have this form for inputting the birthday in html. But I only have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.