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