Hi Guys
My registration page working but along with successful message , i am getting this notice message. Please guide me.
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\test\register.php on line 41
You have successfully Registered
<?
$dbhost = ;
$dbname = ;;
$dbuser = ;;
$dbpass = ;;
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
print_r($_POST);
$utype = $_POST['user_type'];
$user_email = $_POST['user_email'];
$pwd = $_POST['password'];
$pwd2 = $_POST['password2'];
$fname = $_POST['first_name'];
$lname = $_POST['last_name'];
$dob = $_POST['DOB'];
$sex = $_POST['sex'];
$country_origin = $_POST['country_origin'];
$mobile = $_POST['mobile'];
$streetname_no = $_POST['streetname_number'];
$suburb = $_POST['suburb'];
$postcode = $_POST['post_code'];
$how_hear = $_POST['how_you_heard_globall'];
$footy_before = $_POST['footy_Cricket_before'];
$afl_support = $_POST['afl_you_support'];
$lenght_stay_aus = $_POST['lenght_stay_australia'];
$interested_club = $_POST['interested_in_future_club'];
$spl_need = $_POST['any_special_need'];
$checkuser = mysql_query("SELECT email FROM customer WHERE user_email='$user_email'");
$username_exist = mysql_num_rows($checkuser);
if($username_exist > 0){
echo "This email account already register. Please try another.";
unset($user_email);
exit();
}
$query = "INSERT INTO customer (user_type, user_email, password, first_name, last_name, DOB, sex, country_origin, mobile, streetname_number, suburb, post_code, how_you_heard_globall, footy_Cricket_before, afl_you_support, lenght_stay_australia, interested_in_future_club, any_special_need)
VALUES('$utype', '$user_email', '$pwd', '$fname', '$lname', '$dob', '$sex', '$country_origin', '$mobile', '$streetname_no', '$suburb', '$postcode', '$how_hear', '$footy_before', '$afl_support', '$lenght_stay_aus', '$interested_club', '$spl_need')";
mysql_query($query) or die(mysql_error());
mysql_close();
echo "You have successfully Registered";
?>