Hello All,
Rookie here...
I have run into a problem coding my first Registration form with PHP. Everything works great with the form. I just want to know how to check two fields in the database to see if the values being posted already exist. I have one working but, how do I enter in the other check if the one thats in there already initiates the rest of the script?
$q = "SELECT uid FROM table WHERE email = '$email'"; // I want to check another field here before it runs the script below but, at the "else" I need it to read two different error messages base on which one comes back or if both came back with a value greater than 0.
$r = mysqli_query ($dbc, $q) or trigger_error("Query: $q\n<br /> MySQL Error: .mysqli_error($dbc));
if (mysqli_num_rows($r) == 0) { // Available
run the rest of my script....
}else{
echo 'you entered the an existing email address.'
Any suggestions???