Re: [PHP-DB] mysql_numrows

2008-10-14 Thread Chris
$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_ro

Re: [PHP-DB] mysql_numrows

2008-10-14 Thread Bastien Koert
On Sun, Oct 12, 2008 at 5:54 PM, Chris <[EMAIL PROTECTED]> wrote: > Ron Piggott wrote: > >> When I do the following command: >> >> $number_of_entries=mysql_numrows($blog_activity_result); >> >> and there are no rows I get an error (Warning: mysql_numrows(): supplied >> argument is not a valid MySQ

Re: [PHP-DB] mysql_numrows

2008-10-12 Thread Chris
Ron Piggott wrote: When I do the following command: $number_of_entries=mysql_numrows($blog_activity_result); and there are no rows I get an error (Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in ...) Fix the error from $blog_activity_result as someone else

İlgi: [PHP-DB] mysql_numrows

2008-10-12 Thread sahabettin akca
query in error $blog_activity_result , $number_of_entries=mysql_numrows($blog_activity_result); this line before echo mysql_error(); add , you see error . after edit your error :)) 2008/10/12, Roberto Carlos García Luís <[EMAIL PROTECTED]>: > You can use, [EMAIL PROTECTED]($blog_activity_result);

Re: [PHP-DB] mysql_numrows

2008-10-12 Thread Roberto Carlos García Luís
You can use, [EMAIL PROTECTED]($blog_activity_result); with @ you silence the error in the display. Robert C. El 12/10/2008, a las 01:19 p.m., Ron Piggott escribió: When I do the following command: $number_of_entries=mysql_numrows($blog_activity_result); and there are no rows I get an erro

[PHP-DB] mysql_numrows

2008-10-12 Thread Ron Piggott
When I do the following command: $number_of_entries=mysql_numrows($blog_activity_result); and there are no rows I get an error (Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in ...) When that happens I want to display a greeting to invite the user to engage in