Jump to content

[SOLVED] WHERE AND clause not working.


poleposters

Recommended Posts

Hi,

 

I keep getting this error.

 

MySQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'for='2' && iam='1'' at line 1

Date/Time: 10-2-2008 22:44:42

 

Can anyone see what I'm doing wrong? The script works fine if I remove the part && for='$iam' && iam='$for'

 

$query="SELECT * FROM  details LEFT JOIN users ON details.business_id=users.business_id LEFT JOIN description  ON users.business_id=description.business_id LEFT JOIN picture ON description.business_id=picture.business_id LEFT JOIN location ON picture.business_id=location.business_id LEFT JOIN services ON location.business_id=services.business_id WHERE $location='$search' && for='$iam' && iam='$for' ";

Link to comment
https://forums.phpfreaks.com/topic/126743-solved-where-and-clause-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.