Re: Functions and arguments
| From: | Matt | Date: | Thu, 30 Jan 2003 02:01:49 +0000 |
| Subject: | Re: Functions and arguments | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-133579@lists.php.net to get a copy of this message | ||
----- Original Message -----
From: "R0x0r Mc0wnage" <r0x0r@mc0wnage.com>
To: <php-general@lists.php.net>
Sent: Wednesday, January 29, 2003 8:49 PM
Subject: Re: [PHP] Functions and arguments
> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
result
> resource in
> /home/virtual/site125/fst/var/www/html/atracker/assignments/index.php on
> line 15
> Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
> result resource in
> /home/virtual/site125/fst/var/www/html/atracker/assignments/index.php on
> line 33
> Would I be getting this kind of error if $id was not set correctly? I was
> doing a bit of testing and for some reason my sessions aren't registering
or
> something :\
Yes. You should always check the result of the mysql_query statement, and
take some action if it returns false. False means the query failed (and not
that there were no rows returned), so you should at least log the error from
mysql_error(), maybe email it to someone that can do something about it, and
perhaps do more depending on the situation. You shouldn't echo
mysql_error() out to the browser, except while debugging, so as to prevent
information leakage to the bad guys.