Jump to content

[SOLVED] Like clause


Jonob

Recommended Posts

I have a table with something like the following structure:

 

id (PK)

search_term (varchar 15)

 

What I would like to do is find all occurences of matching search_term.

 

For example, lets assume that I have the following records:

id, search_term

1, Maple

2, Oak

3, Elm

 

What I would like to do is pass in something like "Red Maple Tree", and it would return

1, Maple

 

Or "Oak roots" would return

2, Oak

 

Or "El" would return

null

 

I have tried

SELECT id, search_term
FROM import_rule
WHERE %search% LIKE "Red Maple Tree"

but this obviously fails.

 

Any help greatly appreciated.

Link to comment
https://forums.phpfreaks.com/topic/161493-solved-like-clause/
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.