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 ID=-1' at line 1QSTR SELECT * FROM packages WHERE hotel_id= AND ID=-1 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 ID=-1' at line 1QSTR SELECT * FROM supplements WHERE hotel_id= AND ID=-1