I don't what is wrong but there's an error
Error: Incorrect date value: '' for column 'DateBirth' at row 1
I searched for answers but there seems nothing wrong with my code. I used date as datatype for date of birth.
my php script.
<?php
$m = $_POST["month"];
$d = $_POST["day"];
$y = $_POST["year"];
$datebirth = $y . $m . $d;
mysql_query("INSERT INTO StoreTbl (DateofBirth) values('$datebirth')", $con);
?>
Day and Year uses for loop
<?php
echo "<select name='day'>";
for ($i=0; $i<=30; $i++)
{
$day = 1 + $i;
echo "<option value = $day>" . $day ."</option>";
}
echo "</select>";
echo "<select name='year'>";
for($i=0; $i<=59; $i++)
{
$year = 2005 - $i;
echo "<option value = $year>" . $year . "</option>";
}
echo "</select>";
So what's wrong?