george123456724
Technical User
Hi,
I must stress I don't know *anything* about PHP coding!
I am using a PHP MySQL interface. The date field is split into selection lists for date (00 to 31), month (00 to 12) and year (currently 2002 to 2005). I want to change the code to allow me to choose between 2002, 2003, 2004, 2005 and also 0000 - giving the option of an unspecified year in my database.
The code in the php script for generating the year selection box is shown below. The values for start_year and end_year are obtained from a config.php file, which I can easily edit.
Can anyone tell me how I can change the script to get non-sequential values into this selection box as explained above?
_________________
for ($i=$start_year; $i<=$end_year; $i++){
$year_select .= "<option value=\"$i\"";
if($year != "" and $year == $i){
$year_select .= " selected";
} // end if
$year_select .= ">$i</option>";
} // end for
__________________
Many thanks
George
I must stress I don't know *anything* about PHP coding!
I am using a PHP MySQL interface. The date field is split into selection lists for date (00 to 31), month (00 to 12) and year (currently 2002 to 2005). I want to change the code to allow me to choose between 2002, 2003, 2004, 2005 and also 0000 - giving the option of an unspecified year in my database.
The code in the php script for generating the year selection box is shown below. The values for start_year and end_year are obtained from a config.php file, which I can easily edit.
Can anyone tell me how I can change the script to get non-sequential values into this selection box as explained above?
_________________
for ($i=$start_year; $i<=$end_year; $i++){
$year_select .= "<option value=\"$i\"";
if($year != "" and $year == $i){
$year_select .= " selected";
} // end if
$year_select .= ">$i</option>";
} // end for
__________________
Many thanks
George