Link to home
Start Free TrialLog in
Avatar of hankknight
hankknightFlag for Canada

asked on

mySQL Syntax Error: Match / Against

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

ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial