Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
04-21-2011, 08:52 PM #1
- Join Date
- Jan 2011
- Thanked 0 Times in 0 Posts
Searching a database via keyword(s)
On the site I'm building I want users to be able to search user posts, which I have stored in a mysql table. So if a user searches for the keyword tree (for example), I want it to return every user post that contains the word tree.
I just can't wrap my head around how to do this, I imagine there is some sort of function that can help me acheive this, I just don't know of it. I do not want code, I just want someone to point me in the right direction. Thank you
04-21-2011, 09:20 PM #2
Fair warning: It will be slow slow slow on a large table.Code:SELECT list, of, fields FROM table WHERE someField LIKE '%tree%' OR someOtherField LIKE '%tree%'
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.