note 100540 deleted from function.mysql-num-rows by danbrown
| From: | danbrown@php.net | Date: | Fri, 22 Oct 2010 06:23:16 +0000 |
| Subject: | note 100540 deleted from function.mysql-num-rows by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-173366@lists.php.net to get a copy of this message | ||
Note Submitter: sunil at mansainfotech dot com
----
If you try to login process
When we query through mysql_query()
it return an empty resultset hwn the condition did not matches
So try this method
$uname= $_POST['uname'];
$upass= md5($_POST['upass']);
$query = "select * from users_tab where username_user ='$uname' AND password_user =
'$upass'";
$result = mysql_query($query);
if(($result == false)|| mysql_num_rows($result)==false)
{
return '99';
}
else
{
$data = mysql_fetch_array($result);
//print_r("Returnable : ".$data);
return $data;
}