On my form, I have a date field that is not a required field. My problem is if users don't fill in this field and they submit the form, on mysql db, instead of leaving the field blank, it will instead save 1969-12-31 and any succeeding form that has been submitted on the same day will have ascending dates from the 1969-12-31 if this field is once again left blank. What do I change so that mysql will simply leave that field blank. Thanks for reading.
Here are the codes:
<input id="nfud" name="nfud" type="date" class="input-small"/>
Mysql submit query
$nfud = date('Y-m-d', strtotime($_POST["nfud".$n.""]));
$query="insert into number_info (phone_number, data_plan, phone_used, fud, dealID)
values ('".$nphone_number."','".$ndata_plan."','".$nphone_used."','".$nfud."','$dealID')";
mysql_query($query) or die(mysql_error());