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 (cg_status = 1 or cg_status = 2) ORDER BY cg_status ASC, cg_chassis ASC, cg_' at line 1