Jump to content


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


MySQL Syntax

Recommended Posts

Dear anyone who can help.

I am trying to execute a complex query:

$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());

I get this 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 '%web developer%'' at line 1

Any ideas?  I need to use multiple OR and one AND boolean(s)...

Many Thanks.

Regards and Jesus Christ's blessings,

Chris Cundill

Share this post

Link to post
Share on other sites
You are missing the terminating single quote here:
OR skill3 LIKE '%$select_search%)
should be
OR skill3 LIKE '%$select_search%')

Share this post

Link to post
Share on other sites


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.