houssam_ballout
New Member
Hello all,
when I try to run the code below , the following error is generated:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\wamp\www\mini\check.php on line 18
what is that problem?
thanks...
when I try to run the code below , the following error is generated:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\wamp\www\mini\check.php on line 18
what is that problem?
thanks...
PHP:
<?php
require('connect.php');
if(isset($_POST['check']))
{
$username = $_POST['username'];
}
$query = "select username from users where username = " . $username;
$result = mysql_query($query);
$num = mysql_num_rows($result);
mysql_close();
if ($num == 0 )
{
echo "Username available";
}
else
{
echo "not";
}
?>