I need a count and search query to work properly. The count query appears to be working properly, however the search query is not.
Count query:
SELECT COUNT(DISTINCT tg_id)
FROM tg_keywords
WHERE tg_keyword LIKE 'keyword_1' OR tg_keyword LIKE 'keyword_2'
ORDER BY tg_keyword LIKE 'keyword_1' AND tg_keyword LIKE 'keyword_2 DESC
Returns 1 count as expected.
Search query:
SELECT DISTINCT tg_keywords.tg_id
FROM tg_keywords LEFT JOIN tg_info.tg_id=tg_keywords.tg_id
WHERE tg_keyword LIKE 'keyword_1' OR tg_keyword LIKE 'keyword_2'
ORDER BY tg_keyword LIKE 'keyword_1' AND tg_keyword LIKE 'keyword_2' DESC, tg_info.date_added LIMIT 16 OFFSET 1
Returns 0 results (1 is expected)
Any advice would be greatly appreciated
Thanks in advance, Archie