mon question/problem?
| From: | Khristopher_Klaich at nywd dot uscourts dot gov | Date: | Wed, 16 Apr 2003 18:58:33 +0000 |
| Subject: | mon question/problem? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-27124@lists.php.net to get a copy of this message | ||
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>";