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 'AND t.tra_islive = 1 ORDER BY tra_surname ASC, tra_firstname ASC' at line 8