Error

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 caracteristica1_id IS null and caracteristica2_id IS null AND (compres_linie' at line 1
Query: SELECT SQL_CALC_FOUND_ROWS compres_linies.nom, compres_linies.ref, compres_linies.preu, compres_linies.quantitat, compres_linies.caracteristica1_id, compres_linies.caracteristica2_id, compres_linies.id, compres_linies.lang, compres_linies.ordre, compres_linies.comanda_id, compres_linies.producte_id FROM compres_linies WHERE comanda_id =435423 and producte_id = and caracteristica1_id IS null and caracteristica2_id IS null AND (compres_linies.lang='es' OR compres_linies.lang IS NULL) ORDER BY compres_linies.ordre DESC LIMIT 1 OFFSET 0