Errore query
SELECT prodotti_avanzati.*,  IF(PREF.sku is null,0,1) as preferito
                 FROM prodotti_avanzati 
                    LEFT JOIN brand ON prodotti_avanzati.brand = brand.id_brand
                    LEFT JOIN preferiti PREF 
                        ON prodotti_avanzati.id_prodotto = PREF.sku 
                        AND PREF.codice_utente=''
                         
                    WHERE prodotti_avanzati.lingua='it'
                         AND brand.lingua='it' 
                         AND prodotti_avanzati.attivo='Y'
                     AND prodotti_avanzati.brand='BEN' 
                    
                    ORDER BY brand.ordine ASC
                    LIMIT -21, 21
                 
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 '-21, 21' at line 14