Page 1 of 1

Dynamic Date Dropdown

Posted: Tue Aug 31, 2010 9:07 pm
by cjt3007
Okay, so I have a timestamp database. In this database are stored multiple checkin dates for each user. I would like to know how I would make a script that determines whether the checkin is this year or a previous year. Afterwhich I make a dropdown menu that shows the different years a user can select to view the timestamps from that year.

Note: These are SCHOOL YEARS so they can have two different actual numerical years within one academic year. Each school year on July 1 at 12 AM and end on June 30 at 11:59 PM.

Re: Dynamic Date Dropdown

Posted: Wed Sep 01, 2010 8:05 am
by sammonster
You could use MySQL's Date functions to search for a specific year, month, day, or time. You could also update your field to be an INT, store a unix timestamp, and then just have php give you a mktime range and do a select based off that range.

After that, it's a simple matter of Javascript and HTML to pretty up your results.