Re: mon question/problem?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:  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>";
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux