By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,216 Members | 1,013 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,216 IT Pros & Developers. It's quick & easy.

pattern match

P: n/a
Where can I find infi or doc on "pattern match" used within WHERE clause
(mysql).
As I need to matche with PHP variables I'd prfer something adapted to PHP.
In "PHP&MySQL Web Devlpt" (Luke Welling) I can't see much....
Jul 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Michel wrote:
Where can I find infi or doc on "pattern match" used within WHERE clause
(mysql).
As I need to matche with PHP variables I'd prfer something adapted to PHP.
In "PHP&MySQL Web Devlpt" (Luke Welling) I can't see much....


I take it you want the DB to do the matching not PHP.

you want something like:

select cans_of from canned_goods where lower(cans_of) LIKE lower('%beans%');

this will get Beans, beans, Pork & Beans, Kidney Beans, etc.....

here is a good resorce for SQL:
http://www.w3schools.com/sql/default.asp

--
/---+----+----+----+----+----+----++----+----+----+----+----+----+---\
I ph***********@libertydice.org II No nation was ever ruined by I
I http://www.libertydice.org II trade, even seemingly the most I
I remove "3d6" to e-mail II disadvantageous. - Ben Franklin I
\---+----+----+----+----+----+----++----+----+----+----+----+----+---/

Jul 16 '05 #2

P: n/a
In article <bi**********@news-reader3.wanadoo.fr>,
"Michel" <Mi**************@wanadoo.fr> wrote:
Where can I find infi or doc on "pattern match" used within WHERE clause
(mysql).
As I need to matche with PHP variables I'd prfer something adapted to PHP.
In "PHP&MySQL Web Devlpt" (Luke Welling) I can't see much....


This describes MySQL's regular expression implementation:

<http://www.mysql.com/doc/en/Regexp.html>

JP

--
Sorry, <de*****@cauce.org> is een "spam trap".
E-mail adres is <jpk"at"akamail.com>, waarbij "at" = @.
Jul 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.