In your example, you would want to add a + to the start if each word and an * to the end of each word. Which is actually each to do:
$searchStr = '+'.str_replace(' ','* +',$userEnteredText).'*'
Your search string would then end up being: +wash* +mem* +hosp*
MySQL can also do relevance ranking of the results, something FileMaker can't do. You can also make certain words more or less relevant than others. It's just a matter of parsing what the user enters.
On Thursday, May 8, 2003, at 08:59 AM, George Pitcher wrote:
I am currently in the planning stage of a replacement of my Lasso/Filemaker
site.
I've tried out various bits of functionality to get it all to hang together.
I have a question about where I'll be able to bring one of Filemaker's search tricks to MySQL and PHP.
If a user searches for: (unquoted) wash mem hosp, they would find any
records where Washington Memorial Hospital exists, but not washed out memory
(no 'hosp' found). I can tighten things up by doing an exact match/begins
with/ends with.
Can I do the same with PHP/MySQL without asking the user to put '*' into the
search string?
-- Brent Baisley Systems Architect Landover Associates, Inc. Search & Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php