Re: Select where

From: Date: Tue, 20 Mar 2001 15:50:41 +0000
Subject: Re: Select where
References: 1 2 3  Groups: php.db 
Request: Send a blank email to php-db+get-7650@lists.php.net to get a copy of this message
----- Original Message ----- From: Darryl Friesen <Darryl.Friesen@usask.ca> To: boclair <boclair@bigpond.net.au>; <php-db@lists.php.net> Sent: Wednesday, March 21, 2001 1:22 AM Subject: Re: [PHP-DB] Select where > > 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. It's always the simple things. I had the leading " but had escaped the ' around deceased. No excuse but too many lines of printf for a table with styling. Started to escape everything. Many, many thanks Tim Morris

« previous php.db (#7650) next »