puritystandsout Posted July 13, 2006 Share Posted July 13, 2006 Dear anyone who can help.I am trying to execute a complex query:[code]$query1 = mysql_query("SELECT * FROM members WHERE (skill1 LIKE '%$select_search%' OR skill2 LIKE '%$select_search%' OR skill3 LIKE '%$select_search%) AND skill_sought1 LIKE '%web developer%' ") or die (mysql_error());[/code]I get this error:[quote]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 '%web developer%'' at line 1[/quote]Any ideas? I need to use multiple OR and one AND boolean(s)...Many Thanks.Regards and Jesus Christ's blessings,Chris Cundill Quote Link to comment https://forums.phpfreaks.com/topic/14455-mysql-syntax/ Share on other sites More sharing options...
GingerRobot Posted July 13, 2006 Share Posted July 13, 2006 You are missing the terminating single quote here:OR skill3 LIKE '%$select_search%)should beOR skill3 LIKE '%$select_search%') Quote Link to comment https://forums.phpfreaks.com/topic/14455-mysql-syntax/#findComment-57166 Share on other sites More sharing options...
puritystandsout Posted July 13, 2006 Author Share Posted July 13, 2006 Top notch reply.Thanks again. Quote Link to comment https://forums.phpfreaks.com/topic/14455-mysql-syntax/#findComment-57173 Share on other sites More sharing options...
brown2005 Posted July 13, 2006 Share Posted July 13, 2006 good spotting GingerRobot, i couldnt spot that.. lol Quote Link to comment https://forums.phpfreaks.com/topic/14455-mysql-syntax/#findComment-57175 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.