![]() |
MySQL gurus in here now please.
So I've been trying to get a damn search option to work with one of my mainstream projects for the past day or so but it's just not working. Here's the query I'm using:
Quote:
My questions: Why doesn't this work? What am I doing wrong if it's wrong? This has been frustrating the shit out of me. :disgust Thanks to all who will be kind enough to reply. |
put the OR parts in parenthesis, i think that should fix it
$trysrch = @mysql_query("select * from table_name where (item_name like '$srch' || item_name2 like '$srch' || item_name3 like '$srch') && area = '$place' order by item_name asc"); |
You don't understand how "OR" works. Read more grasshopper, read more. :)
|
I believe your statement is being evaluated like this:
item_name like '$srch' OR item_name2 like '$srch' OR item_name3 like '$srch' AND area = '$place' order by item_name asc |
Quote:
|
go fuck your self
|
All times are GMT -7. The time now is 09:52 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc