Re: Select where

From: Date: Tue, 20 Mar 2001 15:22:26 +0000
Subject: Re: Select where
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-7648@lists.php.net to get a copy of this message
> Thanks, I only gave the mySQL but the php scripting is > > $deceased = mysql_query(SELECT * FROM members where > status=\'deceased\'"); > and later > while ($myrow = mysql_fetch_row($deceased)) > > MySQL now says in relation to the *while* line > Warning: Supplied argument is not a valid MySQL result resource Yikes! I hope those are typos, and that you didn't cut and paste that query from your script. If you did, then it needs some work. Try: $deceased = mysql_query("SELECT * FROM members where status='deceased'"); You need the leading double quote before SELECT, and you don't need to escape the single quotes. - Darryl ---------------------------------------------------------------------- Darryl Friesen, B.Sc., Programmer/Analyst Darryl.Friesen@usask.ca Education & Research Technology Services, http://gollum.usask.ca/ Department of Computing Services, University of Saskatchewan ---------------------------------------------------------------------- "Go not to the Elves for counsel, for they will say both no and yes"

« previous php.db (#7648) next »