I normally solve this problem by doing a " 10" test, on the assumption it
is quicker. Something like
for ($i=00;$i$daysinmonth;$i++)
{
$str_i= (string) $i;
if ( $i 10 ) { $str_i = "0$str_i"; }
if ($i == $day)
{
echo("option SELECTED
I need to enable a user to insert an 'NEWS' item into a mySQL table one of
the definable limits for the user is to be the date that the news is to be
displayed. Currently the collum is in a 'date' format and should be stored
in a MMDD - being Australian we are used to the exact reverse of
Jamie wrote:
...
? echo"select name=\"form_date_day\"";
$day = (date ("d"));
$daysinmonth = (date("t"));
for ($i=00;$i$daysinmonth;$i++){
if ($i == $day) {
echo("option SELECTED value=\"$i\"$i/option\n");
} else {
3 matches
Mail list logo