It looks like there is a problem with SQL on line 51 (appointment_edit.php) which works in SQLite but not in MySQL:
foreach ($db->query('SELECT * FROM [doctor] ORDER BY [doctor_name]') as $item) {
It should work fine if you change it like this:
foreach ($db->query('SELECT * FROM doctor ORDER BY doctor_name') as $item) {