Re: Supplied argument is not a valid MySQL result resource

From: Date: Tue, 08 Jan 2002 17:05:13 +0000
Subject: Re: Supplied argument is not a valid MySQL result resource
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-79800@lists.php.net to get a copy of this message
Try this: $parent_sql = "SELECT * FROM categories ORDER BY sort_order ASC"; $parent_result = mysql_query($parent_sql); var_dump($parent_result); while ($parent = mysql_fetch_array($parent_result) ) { <-- problem here $parent_select .= "<option value=\"".$parent['id']."\">".$parent['cat_name']."</option>"; } Regards, Andrey ----- Original Message ----- From: "Dan McCullough" <McWC@rocketmail.com> To: "Andrey Hristov" <ahristov@icygen.com> Sent: Tuesday, January 08, 2002 7:00 PM Subject: Re: [PHP] Supplied argument is not a valid MySQL result resource > here is the sql > > $parent_sql = "SELECT * FROM categories ORDER BY sort_order ASC"; > $parent_result = mysql_query($parent_sql); > while ($parent = mysql_fetch_array($parent_result) ) { <-- problem here > $parent_select .= "<option > value=\"".$parent['id']."\">".$parent['cat_name']."</option>"; > } > --- Andrey Hristov <ahristov@icygen.com> wrote: > > Possibilities: > > 1)There was an error when mysql_query(). Possibly the SQL statement is not correct. Trace > > with > > var_dump()/mysql_errno(). > > 2)You give as parameter to some of mysql_* functions a variable not returned from > > mysql_query(). > > > > HTH > > > > Regards, > > Andrey Hristov > > > > ----- Original Message ----- > > From: "Dan McCullough" <McWC@rocketmail.com> > > To: "PHP General List" <php-general@lists.php.net> > > Sent: Tuesday, January 08, 2002 6:47 PM > > Subject: [PHP] Supplied argument is not a valid MySQL result resource > > > > > > > I know this is a common error, but what does it mean. This snippet of code is > > > something I use > > all > > > the time. > > > > > > help please. > > > > > > dan > > > > > > __________________________________________________ > > > Do You Yahoo!? > > > Send FREE video emails in Yahoo! Mail! > > > http://promo.yahoo.com/videomail/ > > > > > > -- > > > 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 > > > > > > > > > > > ===== > dan mccullough > -------------------------------------------------------- > "Theres no such thing as a problem unless the servers are on fire!" > > > __________________________________________________ > Do You Yahoo!? > Send FREE video emails in Yahoo! Mail! > http://promo.yahoo.com/videomail/ >

« previous php.general (#79800) next »