KyrinComaBlack Posted January 29, 2006 Share Posted January 29, 2006 ok I got it working and everything. Now i'm getting a problem. Ok I created a user and all and it gets put in the table. Then I test out the checking and if says Email is been sent but I just added the same user again :Sheres the code[code]$user_check_sql = mysql_query("SELECT username FROM user WHERE username='$username'") or die(mysql_error()); $email_check_sql = mysql_query("SELECT email_address FROM user WHERE email_address='$email'") or die(mysql_error()); $user_check = !mysql_fetch_row($user_check_sql); $email_check = !mysql_fetch_row($email_check_sql); if($user_check){ print("That Username is already takin' please select a new username<br>\n"); }else{ if($email_check){ print("E-Mail is already in use please use a different email<br>\n"); }else{ $q = mysql_query("INSERT INTO user (username, password, email_address, city, state, country, gender, month, day, year) VALUES('$username', '$password', '$email', '$city', '$state', '$country', '$gender', '$month', '$day', '$year')"); } }[/code] Quote Link to comment https://forums.phpfreaks.com/topic/3273-mysql-problem/ Share on other sites More sharing options...
fenway Posted January 29, 2006 Share Posted January 29, 2006 Sounds like mysql_fetch_row() isn't returning what you expect -- why not check the actual number of rows with mysql_num_rows() instead? Quote Link to comment https://forums.phpfreaks.com/topic/3273-mysql-problem/#findComment-11179 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.