A Database Error Occurred

Error Number: 1064

You 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 type_id' at line 8

SELECT type_id as id, CASE WHEN type_id < 1 THEN "Laptop" ELSE a.name END as name FROM sma_products LEFT JOIN sma_kv_type a ON a.id=sma_products.type_id WHERE brand_id= GROUP BY type_id

Filename: controllers/shop/Shop.php

Line Number: 1376