Another selection box question if someone could help!
I have the following select boxes to pass the date into a string and then into a DATE field of my database.
My question is - how would I retrieve the date and set the fields above to correspond with the date?
I have the following select boxes to pass the date into a string and then into a DATE field of my database.
Code:
<select name="day">
<?php
for ($d = 1; $d <= 31; $d++)
echo "<option value=\"" . $d . "\">" . $d . "</option>";
?>
</select>
<select name="month">
<?php
for ($m = 1; $m <= 12; $m++)
echo "<option value=\"" . $m . "\">" . $m . "</option>";
?>
</select>
<select name="year">
<?php
$max_year = 2005;
for ($y = 2004; $y <= $max_year; $y++)
echo "<option value=\"" . $y . "\">" . $y . "</option>";
?>
</select>
My question is - how would I retrieve the date and set the fields above to correspond with the date?