?
Solved

mySQL Syntax Error: Match / Against

Posted on 2009-04-22
1
Medium Priority
?
333 Views
Last Modified: 2013-12-12
This returns an error

#1064 - 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 'MATCH(`name`,`keywords`,`description`,`custom_keywords`,`naics_keywords`, `naics' at line 1
select * from `organizations`, MATCH(`name`,`keywords`,`description`,`custom_keywords`,`naics_keywords`, `naics_desc`, `p_city`, `promo_text`) AGAINST ('foo' WITH QUERY EXPANSION) AS RELEVANCE, WHERE replace(replace(`name`, ' ', ''),'\'', '') LIKE '%foo%' OR replace(`keywords`, ' ', '') LIKE '%foo%' OR MATCH (`name`,`keywords`,`description`,`custom_keywords`,`naics_keywords`, `naics_desc`, `p_city`, `promo_text`) AGAINST ('foo' WITH QUERY EXPANSION) ORDER BY `name` LIKE 'foo%' DESC, replace(`name`, ' ', '') LIKE 'foo%' ASC, `name` LIKE '%foo%' DESC, replace(`name`, ' ', '') LIKE '%foo%' ASC, RELEVANCE DESC

Open in new window

0
Comment
Question by:hankknight
1 Comment
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 24208494
you have a "," before your WHERE ...
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month16 days, 22 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question