I have have a drop down list which meant to insert date of birth into database cloumn name date_of_birth bt is not wrking it inserts all the data except tha column help what am doing wrong????
$date_of_birth = $_POST['year_of_birth'] . '-' . $_POST['month_of_birth'] . '-' . $_POST['day_of_birth'];
$q = "INSERT INTO driversnew (id, name, location, date_of_birth, car_number,
favourite_track, least_favourite_track, achievements, sponsors, email, image, display)
VALUES ('$_POST[id]', '$_POST[name]', '$_POST[location]','$date_of_birth','$_POST[car_number]','$_POST[favourite_track]', '$_POST[least_favourite_track]','$_POST[achievements]', '$_POST[sponsors]','$_POST[email]', '$image_name','0')";
$rs = mysql_query($q) or die("Problem with the query: $q<br>" . mysql_error());
this the form
<?php
$months = array('','January','February','March','April','May','June','July','August','September','October','November','December');
echo '<select name="month_of_birth">';
for ($i=1;$i<13;++$i) {
echo '<option value="' . sprintf("%02d",$i) . '">' . $months[$i] . '</option>';
}
echo '</select>';
echo '<select name="day_of_birth">';
for ($i=1;$i<32;++$i) {
echo '<option value="' . sprintf("%02d",$i) . '">' . $i . '</option>';
}
echo '</select>';
echo '<select name="year_of_birth">';
$year = date("Y");
for ($i = $year;$i > $year-50;$i--) {
$s = ($i == $year)?' selected':'';
echo '<option value="' . $i . '" ' . $s . '>' . $i . '</option>';
}
echo '</select>';
?>