Re: Not a valid MySQL resource?
| From: | Rasmus Lerdorf | Date: | Sat, 30 Mar 2002 16:48:17 +0000 |
| Subject: | Re: Not a valid MySQL resource? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-90792@lists.php.net to get a copy of this message | ||
Always always always check your queries for errors before trying to use
the result set.
ie.
$result = mysql_query($sql) or die(mysql_error());
(assuming you want a query failure to be a fatal error)
-Rasmus
On Sat, 30 Mar 2002, Brian Waskiewicz wrote:
> Can anyone tell me what is causing the following error:
>
> Warning: Supplied argument is not a valid MySQL result resource in
> /ip/sums/www/test/admin/mailing_list.phtml on line 123
>
> The page will work fine one time, then I'll come back later and get the
> error. I won't change anything, but the page will work later on anyway. I
> know there's nothing wrong with the database server, and the query should
> return results.
>
> Thanks.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>