Jump to content

msyql_query help please


lukerodham

Recommended Posts

Hey guys for some reason the code below, will insert into the data the information required even if there is the same email address already registered, have i done something wrong?

            $query = mysql_query("SELECT * FROM users WHERE email=$email");
            $count = mysql_num_rows($query);
            
            if($count==0){
                mysql_query("INSERT INTO users VALUES(NULL,'$firstname','$lastname','$email','$password','$day','$month','$year','$sex')") or die(mysql_error());
                echo "Well done. Passwords match";
            }
            else {
                echo "Please use another email as this one is already registered.";
            } 

Link to comment
https://forums.phpfreaks.com/topic/238626-msyql_query-help-please/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.