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 `f_fases`.Tor_ID = 44 ORDER BY `f_grupos`.Gru_Nomb' at line 1