Re: mon question/problem?
| From: | mustafa ocak | Date: | Thu, 17 Apr 2003 09:07:59 +0000 |
| Subject: | Re: mon question/problem? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-27134@lists.php.net to get a copy of this message | ||
Mysql date format is yyyy-mm-dd and month and day values could be one digit.
Such that
2003-4-17
HTH
Mustafa
----- Original Message -----
From: <Khristopher_Klaich@nywd.uscourts.gov>
To: <php-db@lists.php.net>
Sent: Wednesday, April 16, 2003 9:58 PM
Subject: [PHP-DB] mon question/problem?
> Hello I have the below code that creates a drop down box which lists
> business days in the future. If I echo out the $form_date variable I
> get
> 2003-17-4 which from what I can tell is how it should work. I then
> have
> a date field in a mysql database that I am trying to insert this
> variable
> in and it is not working and I am guessing it is because that the 4 does
>
> not have a leading 0???? Can anyone give me an idea how to modify my
> code
> to make it have the leading 0 or tell me what is wrong with the code
> below? -Thanks-Khris
>
> $x=getdate();
> print "<select name=\"form_date\" id=\"form_date\">";
> for($i=1;$i<=170;$i++)
> {
> $x=getdate(mktime(0,0,0,$x['mon'],$x['mday']+1,$x['year']));
> if (($x['wday'] != 0) && ($x['wday'] != 6))
> print "<option
>
> value=".$x['year']."-".$x['mday']."-".$x['mon'].">".date("F
> d,Y",mktime(0,0,0,$x['mon'],$x['mday']-1,$x['year']));
> }
> print "</select>";
>