RE: [PHP] Invalid MySQL result resource
| From: | Dan Harrington | Date: | Thu, 13 Sep 2001 05:58:33 +0000 |
| Subject: | RE: [PHP] Invalid MySQL result resource | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-67146@lists.php.net to get a copy of this message | ||
Alright,
I can't believe I'm so blind.
And yes, I will always always perform error checking from this point on
and to eternity. :-)
I'm out of my mind for some reason or another. Can't think straight.
Maybe because I've got CNN on the TV turned on. ick.
Thanks
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:rasmus@php.net]
> Sent: Wednesday, September 12, 2001 10:52 PM
> To: Dan Harrington
> Cc: speedboy; php-general@lists.php.net
> Subject: RE: [PHP] Invalid MySQL result resource
>
>
> > $productresult = mysql_query($productquery);
> > $productinfo = mysql_fetch_array($productresult); //THIS line produces the error
>
> Well, you don't check for errors. Always always always perform proper
> error checking:
>
> $productresult = mysql_query($productquery) or die(mysql_error());
>
> Do that and it will probably be very obvious that your $productquery has
> some sort of error in it.
>
> -Rasmus
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>