Hi all,
I have a registration page for users to make an account on my website. The code I have problems with is to make sure someone doesn’t try to use a username that has already been used.
I’m currently getting the error - “mysql_num_rows() expects parameter 1 to be resource, object given in C:\xampp\htdocs\motorstore\register.php on line 87”
my code:
[php]
$username = $_POST[“username”];
$username = mysqli_real_escape_string($custdb, $username);
if (isset($_POST[‘username’]))
{
if (mysql_num_rows(mysqli_query($custdb, "SELECT * FROM customer WHERE username='$username'")))
echo "Name is taken, please try a different name";
}
[/php]
Any help is great, thanks!
Jack