I have a classified system where I search with PHP and MySQL using LIKE
in two fields:
campo1 like '' or campo2 like ''
The problem is when I look for something like "Green car" it does not display anything for "car" being contained in field 1 and "green" in field 2, or even car come with a word in the middle before the "Green".
Could someone give me a hint how to improve this search?
I tried to use:
SELECT description, title , MATCH ( title, description ) AGAINST ( '$busca' ) AS Score
FROM qtc_ads WHERE MATCH ( title, description ) AGAINST ( '$busca' )
ORDER BY Score DESC LIMIT 50
But MySQL informs me that the fields do not support this type of search and I do not know if this is the best way.
SQL that I currently use to fetch from my system:
SELECT * FROM 'qtc_ads' AS 'qtc_ad' WHERE 'status' = 1 AND 'title' LIKE '%l200%' (1)