hello, i wrote a script for registering users but there's an "error". with AJAX, when i enter a new e-mail address, it skips echo-ing "You have been registered" and goes straight to "This e-mail has already been registered" but the INSERT query did execute. help!
i'm an AJAX noob so please bear with me. tried to put exit(); to the if statement but it didn't help.
if ($row == 0)
//if email not in db, register user
$query2 = "INSERT INTO users (username, userPwd, userAccess) VALUES ('$email', '$userPwd', '$userAccess')";
$result2 = mysql_query($query2);
echo "You have been registered";
//e-mail already registered
echo "This e-mail has already been registered";