Error query 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 t2.type = "model" GROUP BY t1.id, t1.name, t1.number, t1.price, t' at line 5