$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
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
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
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);
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
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