I have a few dates that are entered through a form and posted to a PHP script. I'm using the DATE type for the dates, but if the user doesn't enter anything for the date the the insert will not populate a row in the Database. Is there something i need to do to allow blank date fields?
Check what they enter. If they don't enter a date, then insert NULL instead. Provided, of course, you allow nulls in the field(s).
Hank
Hi there!
If you want to have the date set I suppose you could force it by not allowing the user to enter it.
Just use the date function. Like this:
$date = date("Y-m-d");
If you don't need to give the user an option. Don't do it!
Kristian