I\'m making a search function for my website, which finds relevant results from a database. I\'m looking for a way to count occurrences of a word, but I need to ensure that
You can try this perverted way:
SELECT (LENGTH(field) - LENGTH(REPLACE(field, 'word', ''))) / LENGTH('word') AS `count` ORDER BY `count` DESC