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

From: Date: Wed, 07 Apr 2004 15:06:09 +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-182651@lists.php.net to get a copy of this message
Andy B wrote:
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 im lost i wrote this code hundreds of times and it always works... the query looks right : echo $EditQuery; output: select * from rnjresort.events where Id='1' and that is exactly what i want (i ran that exact string in mysql client) and it gave me what i was looking for...
Did you select a database to run you query on? -- *********************************************************************** * _ __ __ __ _ * John Nichel * * | |/ /___ __ \ \ / /__ _ _| |__ ___ __ ___ _ __ * 716.856.9675 * * | ' </ -_) _` \ \/\/ / _ \ '_| / /(_-<_/ _/ _ \ ' \ * 737 Main St. * * |_|\_\___\__, |\_/\_/\___/_| |_\_\/__(_)__\___/_|_|_|* Suite #150 * * |___/ * Buffalo, NY * * http://www.KegWorks.com john@KegWorks.com * 14203 - 1321 * ***********************************************************************

« previous php.general (#182651) next »