ERROR: 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 rct.ID = rcts.ID_RCT AND rcts.ID_SERVICO = AND rct.FINALIZADO = 1 AND rct.' at line 1 | #0 /home/sigwm/public_html/ws/classes/dao/DAO.class.php(105): mysqli_query(Object(mysqli), 'SELECT DATE_FOR...') #1 /home/sigwm/public_html/ws/classes/dao/laudos/RctServicoDAO.class.php(441): DAO->getRows('SELECT DATE_FOR...') #2 /home/sigwm/public_html/ws/webservice/laudos/reports/generate_graph_perdas2.php(28): RctServicoDAO->listByIdClienteAndIdServico(NULL, NULL, NULL) #3 {main}