I am trying to add a date into mysql db using php variables (code below). This works for all the days that are 10 or over, when they are 9 or lower it becomes an invalid date type as mysql needs date in 0000-00-00 and my code gives it in 0000-00-0.
<?php
$time=$hour.$minute.$sec;
$date=$year.$month.$day;
if($username) {
$sql="insert into meetings (username, mdescription, date, time) values ('$username', '$describe', '$date', '$time')";
$result= mysql_query("$sql");
}
?>
*This is part of the form****
Select a day:
<select name=day><option> <?php echo $currday;?> </option>
<?php
while ($firstday <=31) {
print ("<option value =$firstday>$firstday</option>");
$firstday++;
}
?>