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 'ORDER BY KEYWORD OR CLASSNUM = 530 AND '1984'<=BEGYEAR AND '1996'>=BEGYEAR AND D' at line 1