RE: [PHP] MySQL and LIKE?
| From: | Sam Masiello | Date: | Wed, 25 Apr 2001 21:50:08 +0000 |
| Subject: | RE: [PHP] MySQL and LIKE? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-50371@lists.php.net to get a copy of this message | ||
Why not do something like:
SELECT myTable.col
FROM myTable, otherTable
WHERE myTable.id = otherTable.ID
AND (otherTable.data LIKE "a.%" OR otherTable.data LIKE "s.%" OR
otherTable.data = "io.bean")
HTH
Sam Masiello
Systems Analyst
Chek.Com
(716) 853-1362 x289
smasiello@chekinc.com
-----Original Message-----
From: Jason Caldwell [mailto:jason@thinkingman.org]
Sent: Wednesday, April 25, 2001 5:40 PM
To: php-general@lists.php.net
Subject: [PHP] MySQL and LIKE?
I'm trying to create a multiple pattern search using LIKE (in mySQL) -- the
following doesn't seem to work and was wondering if someone knew of an easy
efficient way of adding multiple search criteria.
SELECT myTable.col
FROM myTable, otherTable
WHERE myTable.id = otherTable.ID
AND otherTable.data LIKE ("a.%" or "s.%" or "io.bean");
So....
LIKE ("a.%" or "s.%" or "io.bean"); <<- doesn't seem to
work like this.
Thanks.
Jason
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net