MySQL Query... Can Someone Tell me What I'm doing wrong?

phaxmohdem

Golden Member
Aug 18, 2004
1,839
0
0
www.avxmedia.com
This is my query, and I canot figure out why it won't work! Keep getting a check syntax error. If I use only one "=" sign, it won't read the value of the variable its supposed to be filtering for.... but I don't get the error. This has me stumped/pissed. Any help would be greatly appreciated.

Thanks...

Query//

"select l_id, l_name,l_slogan,l_phone,l_address FROM basic_listings WHERE l_cat1 == '$id' OR l_cat2 == '$id' OR l_cat3 == '$id' ORDER BY l_name DESC";
 

phaxmohdem

Golden Member
Aug 18, 2004
1,839
0
0
www.avxmedia.com
For Comparison:

If I do the SQL query below, I do not get the error, and I can see my web page, but the $id variable does not fill it self in, and remains blank, resulting in the query returning everything in the table. How do I get the freaking variable to show up in the Query? It has a value assigned, everywhere else in the script except in this query line. I can use the "echo $id;" command anywhere on the page and get the correct result printed.

"select l_id, l_name,l_slogan,l_phone,l_address FROM basic_listings WHERE (l_cat1 = '$id') OR (l_cat2 = '$id') OR (l_cat3 = '$id') ORDER BY l_name DESC";
 

phaxmohdem

Golden Member
Aug 18, 2004
1,839
0
0
www.avxmedia.com
Ok NM I am a retard. The last Query there is working great. My listing counter for the page was screwed up leading me to believe something was wrong when it wasn't. Delete this thread if need be. Thanks anyway guy.