Hi
Thank you for your help in advance.
I have an array generate drop down list and after form is submitted I'd like to have the value and not the key inserted into mysql - i have used array_value, implode and I either get a blank entry, 'array' entry, or the key.
any help would be appreciated.
$months = array (1=>'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
if(isset($_POST['Submitted'])) {
$sticky_months = $_POST['month'];
}
echo '<select id="size-1" name="month">';
echo '<option value="sm" >Select Month</option>';
foreach ($months as $key => $value) {
if($key == $sticky_months) {
echo '<option value="' . $key .'" selected>' . $value . '</option>';
}else{
echo '<option value="' . $key .'">' . $value . '</option>';
}
}
$query = "INSERT INTO summer09 (user_id, reg_date, month) VALUES (NULL, NOW(),'$month')";