----- Original Message -----
From: "Wil" <[EMAIL PROTECTED]>
To: <php-general@lists.php.net>
Sent: Thursday, January 06, 2005 9:35 PM
Subject: [PHP] Php error with MySql


> I get the following error
>
> Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
> resource in /home/wilmail/public_html/elblog.php on line 7
> &n=&   //error ends here
>
> with the following bit of code
>
> $qResult = mysql_query ("SELECT * FROM blog_entries ORDER BY id DESC");
>

Try  " echo mysql_error() " just after your query. It's rather common to
make typos or forget to select DB.

> $nRows = mysql_num_rows($qResult);
> $rString ="&n=".$nRows;
>
> If I am just naming a variable how is the argument not valid?
>
> Thanks,
>
> Wil
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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

Reply via email to