문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top