Your Location is: Home > Php

MySQL search query returns unintended value on Appointment Booking module

From: Lisbon View: 3802 vignesh ds 

Question

I am writing appointment system in php MySQL, I got struck in between in showing available time

My shift_timing table holds data for DoctorID, available time for each day. My appointment table holds doctorID, booked date, day and time.

As far this it works fines,

When I try to book other date which falls on same day as booked in 1st appointment, it is not showing the booked time of previous appointment.

MY Query,

SELECT s.TIME 
  FROM lw_shifttimings_t2020 s 
  LEFT
  JOIN appointmenttest a 
    ON s.TIME = a.TIME 
 WHERE a.TIME IS NULL 
   AND s.DID = $doctor_id 
   AND s.DAY = '$day' 
   AND a.date = '$date'

            

can some one help me with this?

Best answer