poleposters Posted October 2, 2008 Share Posted October 2, 2008 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 More sharing options...
poleposters Posted October 2, 2008 Author Share Posted October 2, 2008 WHOOPS! It was probably a bad idea to name a column in my database "for". I've changed it and it works fine. Link to comment https://forums.phpfreaks.com/topic/126743-solved-where-and-clause-not-working/#findComment-655539 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.