Jump to content

check for clashing date ranges


aleX_hill

Recommended Posts

OK, this might be more of a mysql query, but I think I am more looking at the PHP side of things to figure it out.

 

I have a sql database with the following structure:

id

start_date

end_date

file

 

Then there is a php page which displays "file" if todays date is within the "start_date" - "end_date" range.

 

I also have a form with the three fields to upload into the database. The problem I have is that the display page only has room for 2 files, so I want to warn/disallow the user if there are more then 2 files scheduled for any day.

 

I am not really sure about how to do this. In the upload page i have a listing of all the current files, so i am thinking that in populating this table I can check for duplicates and notify the user, but I am not sure how to check the ranges properly.

 

Any light shed on this will be a big help.

 

Cheers

Link to comment
https://forums.phpfreaks.com/topic/191711-check-for-clashing-date-ranges/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.