Hi There,
I am trying to a database search for something using
LIKE '%$something%'
It works fine for one word like if I search "elephant" it returns the rows with "elephant"
BUT, if I search "blue elephant" it only returns rows with the string "blue elephant" and not just "elephant". What I want is when I search "blue elephant" for mySQL to return all results with "blue" or "elephant" in them.
I know I could probably do this with some PHP code, but was wondering if there is a beter way with mySQL?
Thank You in Advance!
I am trying to a database search for something using
LIKE '%$something%'
It works fine for one word like if I search "elephant" it returns the rows with "elephant"
BUT, if I search "blue elephant" it only returns rows with the string "blue elephant" and not just "elephant". What I want is when I search "blue elephant" for mySQL to return all results with "blue" or "elephant" in them.
I know I could probably do this with some PHP code, but was wondering if there is a beter way with mySQL?
Thank You in Advance!