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