Input into MySQL - Date field
Hi everyone,
I've got a simple form with a date input field, the data goes into a MySQL database, column formatted to 'DATE'.
GetSQLValueString($_POST['projstart'], "date"),
However, when I try to submit the form,it tells me:
Incorrect date value: '04/08/2009' for column 'projstart' at row 1
I'm guessing this is due to '04/08/2009', being viewed as a string, not a date.
How do I change this to input into the database, as a DATE.???
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO tbl_projects (projtitle, projstart, projdue, FK_custid, FK_langsid, projcontact, projanalysis, projtype, projstatus, projurl) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['projtitle'], "text"),
GetSQLValueString($_POST['projstart'], "text"),
GetSQLValueString($_POST['projdue'], "text"),
GetSQLValueString($_POST['FK_custid'], "int"),
GetSQLValueString($_POST['FK_langsid'], "text"),
GetSQLValueString($_POST['projcontact'], "text"),
GetSQLValueString($_POST['projanalysis'], "text"),
GetSQLValueString($_POST['projtype'], "text"),
GetSQLValueString($_POST['projstatus'], "text"),
GetSQLValueString($_POST['projurl'], "text"));
