NYCPHP Meetup

NYPHP.org

[nycphp-talk] MySQL WHERE clause question

Jeff jsiegel1 at optonline.net
Fri May 9 09:21:10 EDT 2003


What's the difference between "SELECT * FROM `table` WHERE `column`
REGEXP "[[:blank:]]ford[[:blank:]]"
and using this - "DE_sDescription LIKE  'ford %' OR DE_sDescription LIKE
'% ford' OR DE_sDescription LIKE  '% ford %'"

In this case of the former (the REGEXP) it would seem that if "ford" is
the first word in the text it would not pick it up since there is no
blank/space before "ford" at the beginning of the text.

Is this correct?
Or...in terms of speed, would it be better to use the REGEXP expression
in the same way I'm using the "%" wildcard? (that is...with the
different variations of blanks).

Jeff

 




More information about the talk mailing list