hi could someone help me with this please? the line that says
if (mysql_num_rows($check)==0)
returns and error message. i basically want it to say that if it doesnt find any entries it can go ahead and continue with the code. thanks and here is the code in context:
if ($submit){
if $fullname&&$towncity&&$state&&$country&&$zipcode&&$email&&$phone&&$profession&&$username&&$password&&$repeatpassword){
$check = mysql_query(“SELECT FROM users WHERE username=’$username’”);
if (mysql_num_rows($check)==0){
if ($password==$repeatpassword){
//check char length of username and fullname
if (strlen($username)>25||strlen($fullname)>25) {
echo “Length of username or fullname is too long. The maximum amount of characters should not exceed 25.”;
} else {
//check password length
if (strlen($password)>25||strlen($password)<6) {
echo “Password must be between 6 and 25 characters long.”;
} else {
//register the user
//incrypt password
$password = md5($password);
$repeatpassword = md5($repeatpassword);
//open and connect to database
$connect = mysql_connect(“localhost”,“root”, “tracer1300”);
mysql_select_db(“phplogin”); //select database
$query= mysql_query(“INSERT INTO users VALUES(’’, ‘$fullname’, ‘$address1’, ‘$address2’,
‘$towncity’, ‘$state’, ‘$country’, ‘$zipcode’, ‘$email’,
‘$phone’, ‘$altphone1’, ‘$altphone2’, ‘$certtrack’,
‘$profession’, ‘$username’, ‘$password’ , ‘$date’, ‘’)”);
die (“You have been registered, to login click here”);
}
}
} else echo “Your passwords do not match, please make sure passwords match.”;
} else echo “That username is already taken, please select another username”;
} else echo "Please fill in all required fields marked by * ";
}