Jump to content

Recommended Posts

Hi, I'm developing a system for my school so the school administrators can plan their events.

 

In every event there are people which are inserted to a MySQL table called 'people'. The structure for that table is:

 

id_person

name_person

mail

cost_per_hour

 

Then they are added to a table called 'events' which has the following structure:

 

id_event

id_person

name_event

start_date (DATE TIME)

end_date (DATE TIME)

 

So let's say they add the person 'Joe' to the event 'cleaning our school' which starts on March 17th, 2009 and ends May 20th, 2009. The event will happen in all the previous days from 10:00 AM to 11:00 AM and the row for that will be:

 

id_event=1

id_person=1

name_event=Joe

start_date= 2009-03-17 10:00:00

end_date= 2009-05-20 11:00:00

 

BUT HERE IS THE GREAT PROBLEM

 

Let's say that the admins want to use 'Joe' in a different event that starts on the same starting day and ends on the the same last day. BUT IT STARTS AT 5:00 PM AND ENDS 6:00 PM INSTEAD.

 

How can I make a script that returns 'Joe' as available on that days for all the hours BUT from 10:00 AM to 11:00 AM?

 

Do I have to modify my 'events' table structure?

 

Any help will be apreciated

 

Link to comment
https://forums.phpfreaks.com/topic/149904-phpmysql-availability-problems/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.