Help with entering a date in a form
Not sure what's going on here, but its probably something simple, and me missing something obvious...
Basically I have a form to add a record to a database table.
I have two date fields in the table, of the type, Date.
This is my code for adding the record :
// Add columns
$ins_clients->setTable("clients");
$ins_clients->addColumn("name", "STRING_TYPE", "POST", "name");
$ins_clients->addColumn("company", "STRING_TYPE", "POST", "company");
$ins_clients->addColumn("website", "STRING_TYPE", "POST", "website");
$ins_clients->addColumn("tel", "STRING_TYPE", "POST", "tel");
$ins_clients->addColumn("mobile", "STRING_TYPE", "POST", "mobile");
$ins_clients->addColumn("email", "STRING_TYPE", "POST", "email");
$ins_clients->addColumn("enquirydate", "DATE_TYPE", "POST", "enquirydate");
$ins_clients->addColumn("business", "STRING_TYPE", "POST", "business");
$ins_clients->addColumn("future", "STRING_TYPE", "POST", "future");
$ins_clients->addColumn("potential", "STRING_TYPE", "POST", "potential");
$ins_clients->addColumn("callback", "DATE_TYPE", "POST", "callback");
$ins_clients->addColumn("notes", "STRING_TYPE", "POST", "notes");
$ins_clients->setPrimaryKey("ID", "NUMERIC_TYPE");
And these are the form fields for the dates :
<input type="text" name="enquirydate" id="enquirydate" value="<?php echo KT_formatDate($row_rsclients['enquirydate']); ?>" size="32" />
<input type="text" name="callback" id="callback" value="<?php echo KT_formatDate($row_rsclients['callback']); ?>" size="32" />
All of which seems about right.
But even when I enter dates in the format 2010-09-23, all that's being written back to the database is 0000-00-00.
Any ideas where I'm going wrong?
Thanks.
