Fatal error: Uncaught Exception: 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 'GROUP BY numero_id ORDER BY numero' at line 1 query: SELECT articolo.id AS articolo_id, articolo.chiave AS articolo_chiave, numero_id, numero, SUM(quantita) AS quantita, negozio_id FROM magazzino LEFT JOIN articolo ON articolo_id=articolo.id LEFT JOIN numero ON numero_id=numero.id WHERE quantita>0 AND negozio_id IN (11) AND gruppo_id='' AND colore_id= GROUP BY numero_id ORDER BY numero in /home/divasoft/public_html/class/MysqliDb.php:1821 Stack trace: #0 /home/divasoft/public_html/class/MysqliDb.php(1429): MysqliDb->_prepareQuery() #1 /home/divasoft/public_html/class/MysqliDb.php(513): MysqliDb->_buildQuery(NULL) #2 /home/divasoft/public_html/single.php(11): MysqliDb->query('SELECT articolo...') #3 {main} thrown in /home/divasoft/public_html/class/MysqliDb.php on line 1821