I have the following query that works great. However, I want to add some functionality to it. I would like to advance my query by a month at a time. For example, the following query returns all of the records for this month. But Now I want to see next month, then the month after that. OR Last month then the month before that.
Any ideas on where to start?
$sql->query("SELECT doctor_doctor.doctor_id, doctor_doctor.first_name AS first_name, doctor_doctor.last_name AS last_name, doctor_schedule.doctor_id, doctor_schedule.schedule_date AS date, doctor_schedule.time AS time, doctor_schedule.location_id
FROM doctor_doctor, doctor_schedule
WHERE MONTH(doctor_schedule.schedule_date) = MONTH(CURDATE()) AND doctor_doctor.doctor='1' AND doctor_doctor.doctor_id=doctor_schedule.doctor_id AND doctor_schedule.location_id='1'
ORDER BY date DESC");