NYCPHP Meetup

NYPHP.org

[nycphp-talk] MySQL WHERE clause question

Bhulipongsanon, Pinyo Pinyo.Bhulipongsanon at usa.xerox.com
Fri May 9 09:09:21 EDT 2003


Good point

-----Original Message-----
From: Ed McCarroll [mailto:Ed at ComSimplicity.com]
Sent: Friday, May 09, 2003 12:13 AM
To: NYPHP Talk
Subject: RE: [nycphp-talk] MySQL WHERE clause question


> "Select * Where Description Like 'ford %' or like '% ford' or
> like '% ford %'"

This won't find "Buy a ford."

I'm not an SQL expert, but I'm constantly dealing with similar issues
in a "search and replace" context.

Could you first pass the Description through a regexp that translates
all punctuation into spaces?  It could also put a space before and
after the Description, so that you could skip the "Like 'ford %'"
and "Like '% ford'" parts.

Regards,

  Ed

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ed McCarroll                          MailTo:Ed at ComSimplicity.com
ComSimplicity                                      (310) 838-4330
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 



--- Unsubscribe at http://nyphp.org/list/ ---




More information about the talk mailing list