Jump to content

Archived

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

puritystandsout

MySQL Syntax

Recommended Posts

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

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.