Domanda

Hi guys i've written/borrowed some code to allow free text searching on my site what i'm ending up with is the following search string for a simple search, I only started learning PHP,MYDSQL, Jquery a couple of weeks ago so its probably easy:

SELECT * match (body) against (' cleaning office ') as relevance
FROM jobs
WHERE match (jobbody) against ('cleaning')>0
    AND match (body) against ('office')>0
HAVING relevance>0
ORDER BY relevance DESC

This throws a syntax error, I know its a really simple question but I just cant seem to get my head round where i'm going wrong, any pointers would be appreciated.

È stato utile?

Soluzione

You need a comma after the SELECT *. That appears to be where your syntax error is coming from.

Also, for next time, be sure to post the syntax error you're getting. MySQL errors are usually pretty helpful and informative.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top