Re: mysql_query
| From: | Rasmus Lerdorf | Date: | Tue, 09 Jan 2001 17:56:54 +0000 |
| Subject: | Re: mysql_query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-33509@lists.php.net to get a copy of this message | ||
> It appears on browser:
> ____________
> Warning: Supplied argument is not a valid MySQL result resource in
> /home/cco/castoldi/public_html/teste/index.php on line 10
> No Rows founded
> _____________
>
> The php code is:
> ________
> if (mysql_numrows($result) > 0) {
> echo "Rows founded";
> } else {
> echo "No Rows founded";
> }
> _______
>
> What is this message?
That means your $result variable is invalid which usually happens when you
query fails. Do this:
$result = mysql_query(...);
if(!$result) echo mysql_error();
-Rasmus