Re: PHP/mySQL query problem...
| From: | Andrey Hristov | Date: | Mon, 27 Aug 2001 18:27:05 +0000 |
| Subject: | Re: PHP/mySQL query problem... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-64674@lists.php.net to get a copy of this message | ||
Use as many () as needed so WHERE clause to be meaningful. Of course you can use operators priority,
but it's better with ()
----- Original Message -----
From: "Jeff Lewis" <jeff@hyrum.net>
To: <php-general@lists.php.net>
Sent: Monday, August 27, 2001 9:09 PM
Subject: [PHP] PHP/mySQL query problem...
Guys, why isn't this working? :)
SELECT * FROM links WHERE name LIKE "%te%" OR description LIKE "%te%" OR url
LIKE "%te%" AND approved="1" LIMIT 5
I am using a PHP script to add items to the database and a small search file to grab them. Thing
is, I want the above to grab ONLY
ones that have approved = 1. In the database they are all = 0. Is there a problem with my SQL
query?
Jeff