Re: mysql_numrows

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




$num_rows = -1;
if (!$result || mysql_err_no($result) != 0)
{
  $num_rows = mysql_num_rows($result);
}

if ($num_rows >-1){
//do something here

}

Don't you have that backwards?

If there is a result && there is no error, do the num_rows.

if ($result && mysql_err_no($result) == 0) {
  $num_rows = mysql_num_rows($result);
}

--
Postgresql & php tutorials
http://www.designmagick.com/


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux