Re: Why is this query killing me?
| From: | Alex Shi | Date: | Wed, 17 Oct 2001 17:52:48 +0000 |
| Subject: | Re: Why is this query killing me? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-71366@lists.php.net to get a copy of this message | ||
Why you leave a space between the keyword and '%' on each side of it ?
Alex
----- Original Message -----
From: "Jeff Lewis" <jeff@hyrum.net>
To: <php-general@lists.php.net>
Sent: Wednesday, October 17, 2001 1:45 PM
Subject: [PHP] Why is this query killing me?
I am creating an advanced search with PHP and pulling from mySQL and here is
an example of a query I have built:
SELECT pub, class, startdate, adtext FROM classifieds WHERE (pub='KWR' OR
pub='GUE') AND (startdate<'17-Oct-01') AND ( adtext LIKE '% German
%' OR
adtext LIKE '% car %');
Now with this, it returns an ad about German sheppard pups but doesn't
return any of the dozens of ads about cars. Now if I use german in lower
case it won't return the German Sheppard pups ad as well!!
What am I doing wrong?
Jeff