You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and par_resultado is null and par_tipo = 0 ORDER BY fix_fecha_cam ASC limit ' at line 2