How to Create an Availiable Timeslot Dynamically With PHP and Mysql?

Avatar
  • updated
  • Answered

Hello everyone,i want a web service and i want to get availiable time-slot in result,let me explain

I have mysql table name "booking",and here is strcture of table (start_time and end_time datatypes are timestamp (2019-7-30 10:01:50 to 2019-7-30 11:00:50 ))

id shop_id user_id start_time end_time

1 1 3 1564461110 1564464710

now as database showing shop_id(3) is already booked for 1 hour (10:00 to 11:00)

Now i just want that if i pass "70" minutes (dynamically) then 1 hour of time-slot(dynamically timeslot) should display like following

09:00 - 10:00 availiable

12:00 - 13:00 availiable

12:00 - 14:00 availiable

(In above result 10:00 to 11:00 is missing because 70 minutes is 1 hour 10 minutes, if i pass less than 30 minutes

in that case availiable time slot of 30 minutes should show )

How can i do this ?

Avatar
IMH Support Agent 3
  • Answered

Thank you for submitting a question about getting available time slots dynamically with PHP and MySQL. We're unable to provide development support. I'd suggest contacting a PHP developer for further assistance.