You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') AGAINST ('Reflective running gear') AND g.published = 1' at line 1 SQL=SELECT count(*) FROM jos_hwdvidsgroups AS g LEFT JOIN jos_users AS u ON u.id = g.adminid WHERE MATCH () AGAINST ('Reflective running gear') AND g.published = 1