Re: warning:supplied argument to mysql_fetch_array not valid resource type?

From: Date: Wed, 07 Apr 2004 15:09:20 +0000
Subject: Re: warning:supplied argument to mysql_fetch_array not valid resource type?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-182653@lists.php.net to get a copy of this message
From: "Andy B" <aborka1@wmis.net> > i have this query set: > $EditQuery="select * from $EventsTable where Id='$edit'"; > $query=mysql_query($EditQuery)||die(mysql_error()); > //later in the code i have this: > while($old=mysql_fetch_array($query)){ > //do stuff > } > when i run the page i get: > warning: supplied argument to mysql_fetch_array is not a valid mysql > resource type on line 98 You must be overwriting $query somewhere before you use it in mysql_fetch_array(). Do a var_dump() on $query just before you try to retrieve rows from it. ---John Holmes...

« previous php.general (#182653) next »