Forums

PHP

This topic is locked

drop down list using dates?

Posted 07 Jun 2007 05:13:34
1
has voted
07 Jun 2007 05:13:34 Kiel Fellow posted:
I want to create a drop down list that will show the previous 7 days from a date stored in a mysql database

Edited by - tapigy on 07 Jun 2007 05:36:45

Edited by - tapigy on 07 Jun 2007 08:18:35

Replies

Replied 07 Jun 2007 13:15:56
07 Jun 2007 13:15:56 Alan C replied:
This sounds like it could get messy <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle> because of the possibility of month changes when the date is during the first few days of each month.

I did something similar with times where I wanted to ask for the user´s time offset from server time, so rather than asking them that question I retrieved the current time, then generated a drop-down list whose list items were the date/time and values were the hours offset from server time.

I don´t have the code on this machine but can get it if it´s of interest
Replied 09 Jun 2007 07:26:58
09 Jun 2007 07:26:58 Greta Garberini replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I want to create a drop down list that will show the previous 7 days from a date stored in a mysql database

Edited by - tapigy on 07 Jun 2007 05:36:45

Edited by - tapigy on 07 Jun 2007 08:18:35
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

<ul><li>make a recordset with the date field</li><li>read all you need at php.net/strftime </li><li>make a dynamic pulldown menu with a repeated region in it </li></ul>

And make sure the right Locale() is set.

Hope this helps

Edited by - rhc on 09 Jun 2007 07:40:00

Reply to this topic