mySQL Syntax Error: Match / Against

Posted on 2009-04-22
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

Question by:hankknight
    1 Comment
    LVL 142

    Accepted Solution

    you have a "," before your WHERE ...

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
    Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

    745 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now