[101] DB not initialized. db_select(): 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 (items.office_id=0 OR items.office_id=0 OR items.office_id=0)' at line 4 in SELECT items.*, office.sn, office.title FROM doctor_timetable AS items LEFT JOIN offices AS office ON items.office_id=office.id Where items.doctor_id= AND (items.office_id=0 OR items.office_id=0 OR items.office_id=0)