• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Searching for multiple items using PHP/SQL statements?

joshg

Golden Member
Hey gang, got one that stumped me...

extreme-computing.com
Go there and then do a search.. Right now you can only do one word at a time. Does anyone know of a valid SQL statement so that I can call for the multiple search terms all at once? I get a parse error when I try this:

"SELECT * FROM products WHERE prodName LIKE \"%ereg_replace(" ", "% OR prodName LIKE \"%", $search)%\";

(which, that is doing this.. say there are three search words entered there, then it would create the SQL statement saying:
SELECT * FROM products WHERE prodName LIKE "%searcTerm1%" OR prodName LIKE "%searchTerm2%" OR prodName LIKE "%searchTerm3%";
)

So, anyone have tips on why this is NOT working? it DOES work whenever it says something like
SELECT * FROM products WHERE prodName LIKE "%blah%" OR prodDesc LIKE "%blah%"
but it seems like having two instances of one field is tripping it up.. what should I do? Any suggestions? Thanks!

- Josh
 
Back
Top