Hi all.
I I solve this problem I can go to bed.
I am trying to insert a date into my table. Simple I know but I cannot get this to work.
My SQL INSERT query is this
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO amember_bfr (id, `t_date`, title, firstname, lastname, telephone, email, location, pin, sec, carriername) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['id'], "int"),
GetSQLValueString($_POST['t_date'], "date"),
GetSQLValueString($_POST['title'], "text"),
GetSQLValueString($_POST['firstname'], "text"),
GetSQLValueString($_POST['lastname'], "text"),
GetSQLValueString($_POST['telephone'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['location'], "text"),
GetSQLValueString($_POST['pin'], "int"),
GetSQLValueString($_POST['sec'], "int"),
GetSQLValueString($_POST['carriername'], "text"));
mysql_select_db($database_baggageppin, $baggageppin);
$Result1 = mysql_query($insertSQL, $baggageppin) or die(mysql_error());
The form I am using looks like this:
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
echo $t_date = date("Y-m-d");
Theres a lot more in the form but I left it our for easier reading.
If I echo the $t_date var "
$_SESSION['$t_date'];
I can see the correct date, todays date.
But when I look in the data table all I see is "0000-00-00"
I know i'm missing something but what.