![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 | |
Confirmed IT Professional
Industry Role:
Join Date: Nov 2005
Location: Hollywood, CA
Posts: 3,744
|
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. ![]() Thanks to all who will be kind enough to reply.
__________________
The Best Affiliate Software, Ever. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Feb 2002
Location: Las Vegas
Posts: 6,504
|
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");
__________________
112.020.756 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Let slip the dogs of war.
Industry Role:
Join Date: Jan 2003
Location: Bermuda
Posts: 17,263
|
You don't understand how "OR" works. Read more grasshopper, read more.
![]()
__________________
. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Let slip the dogs of war.
Industry Role:
Join Date: Jan 2003
Location: Bermuda
Posts: 17,263
|
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
__________________
. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
Confirmed IT Professional
Industry Role:
Join Date: Nov 2005
Location: Hollywood, CA
Posts: 3,744
|
Quote:
![]() ![]()
__________________
The Best Affiliate Software, Ever. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Join Date: Apr 2002
Location: Ft liquordale FL
Posts: 6,481
|
go fuck your self
__________________
![]() IS Prime Hosting Bald Head Shine "BT" The American Dream, baby! " THE HOST WITH THE MOST!" My ICQ 122994792 |
![]() |
![]() ![]() ![]() ![]() ![]() |