Menu
I have the following code and have problem that it gives me
result :
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in…it works if this is alone but when I put into my web site script it shows me this message. Could you help me what can be wrong?
my Code:
//search for name
$un = $_POST[‘username’];
$query = “SELECT username FROM login WHERE username=’$un’ LIMIT 1”;
$result = mysql_query($query);
$num_rows = mysql_num_rows($result); //Check how many rows are in result
if($num_rows > 0) {
echo “This $un is in DataBase”;
}
else {
echo “This $un is not correct”;
}