This means that your sql query means line no 13
[PHP]$query = "SELECT * FROM users WHERE username=’$username’ and password=’$password’ "; [/PHP]
be sure that the username and password match the value in database. The error is because, the query dont get the result, thats why its giving this error. ok to check the error do one thing,
[PHP]
/// more code
$query = "SELECT * FROM users WHERE username=’$username’ and password=’$password’ ";
$result = mysql_query($query);
$row = mysql_fetch_array($result) or die(mysql_error());
echo $row['username']; // its just cheking the query giving the result or not ok ;
.. more code to write..
[/PHP]
when the query get the result, the error will automtically rectified. ok
Quote:
Originally Posted by priyakollu
After placing tht session_start();
in else part i got this error
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\sunkalpid\login.php on line 15