I have recieved this, Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\...register.php on line 16
I dont understand to be honest what this mean as i am new to php and mysql.
What do i need to do to fix this problem?
Below is my php.
<?php
include("db.php");
if (isset($_POST) && isset($_POST) && isset($_POST))
{
//Prevent SQL injections
$username = mysql_real_escape_string($_POST);
$email = mysql_real_escape_string($_POST);
//Get MD5 hash of password
$password = md5($_POST);
//Check to see if username exists
$sql = mysql_query("SELECT username FROM users WHERE username = '".$username."'");
if (mysql_num_rows($sql>0));{
die ("Username taken.");
}
mysql_query("INSERT INTO users (username, password, email) VALUES ( '$username', '$password', '$email')") or die (mysql_error()); echo "Account created.";
}
?>