SELECT SUM(rate) AS rating,COUNT(*) AS quantity,tovar_id FROM `reviews` WHERE tovar_id= GROUP BY tovar_idYou have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'GROUP BY tovar_id' at line 1