PDO Error: getRow(): SQLSTATE[42000]: Syntax error or access violation: 1064 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 sche_date = '2023-12-05'' at line 4
SELECT schedule.*,schedule.id AS id,schedule.start_time AS start_time,schedule.end_time AS end_time,date_format(schedule.start_time, '%Y-%m-%d') AS startDate,date_format(schedule.end_time, '%Y-%m-%d') AS endDate,date_format(schedule.end_time, '%H:%i') AS endTime,date_format(schedule.start_time, '%H:%i') AS startTime,date_format(schedule.end_time, '%H:%i') AS endTime,date_format(schedule.start_time, '%H') AS startHour,date_format(schedule.end_time, '%H') AS endHour,date_format(schedule.start_time, '%i') AS startMin,date_format(schedule.end_time, '%i') AS endMin,shop.id AS shopId,shop.name AS shopName,worker.*,worker.id AS workerId,worker.name AS workerName FROM schedule LEFT JOIN shop ON schedule.shop_id = shop.id LEFT JOIN worker ON schedule.worker_id = worker.id WHERE schedule.worker_id = AND sche_date = '2023-12-05'