I have been searching the web for this but cant find it anywhere, i want to search my mysql database with php but i want it to find records if just one of the search term word are met.
eg.
Search term from form = "one two three"
My database has a record with a field that equals "one two" i want it to select this field by matching each word individually.
What would the query look like?
Hope i conveyed my message accross.
mcatominey 0 Newbie Poster
Recommended Answers
Jump to Post1. You need to use explode() to get all the search terms into an array.
2. Create an SQL 'where' clause with multiple OR / LIKE parts from the array.
3. Build the query and run it.$form_output is the output from the search textbox.
$searchArray …
All 2 Replies
Reply to this topic Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.