Jump to content

Match start of any word


themire

Recommended Posts

Hi,

 

I'm looking for an SQL query to match the start of any word in a list of words for an auto-suggest dropdown.

 

For example, if the query is for 'and' I don't just want to have :

 

WHERE LEFT ($string, 3)=='and'

 

but match it to the start of any word in the string.

 

So, therefore a search for 'and' would match with both

 

'and justice for all'

 

AND

 

'jack and jill'

 

Any help would be greatly appreciated,

Regards

Link to comment
https://forums.phpfreaks.com/topic/126876-match-start-of-any-word/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.