Re: Problem with MySQL Query
| From: | CPT John W. Holmes | Date: | Wed, 23 Jul 2003 21:19:16 +0000 |
| Subject: | Re: Problem with MySQL Query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-156538@lists.php.net to get a copy of this message | ||
Take out the plus sign... type != 'Meal Plans'
And using single quotes in your query might make things easier (no
escaping...)
$dbqueryshipping1 = "select * from tempuserpurchase where
usersessionid='$User_Shopping_Id' and day='1' and type!='Meal
Plans'";
You don't need quotes around '1' since it's an integer, but MySQL is
forgiving.
---John Holmes...
----- Original Message -----
From: "Phillip Blancher" <phil@ontarioweb.ca>
To: "PHP List" <php-general@lists.php.net>
Sent: Wednesday, July 23, 2003 5:08 PM
Subject: [PHP] Problem with MySQL Query
Problem with mySQL Query
This is the query I have:
$dbqueryshipping1 = "select * from tempuserpurchase where
(usersessionid=\"$User_Shopping_Id\") and day=\"1\" and
type!=\"Meal+Plans\"
";
What I want to do is to select everything from tempuserpurchase that matchs
the user session and the day, so long as type is not "Meal Plans"
However it is not excluding "Meal Plans"
Any Suggestions.
Thanks in advance,
Phil
__________________
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.501 / Virus Database: 299 - Release Date: 7/14/2003