Maybe something else is wrong? I changed the date line to have the time input as the second parameter. The problem is now there is a syntax error on line 22? It is the line where $date =MySQLi($_GET['due_date']);
Parse error</b>: syntax error, unexpected '(', expecting T_STRING or T_VARIABLE or '{' or '$' in <b>/Library/WebServer/Documents/ajax/form_handler_copy.php</b> on line <b>22</b><br />
It isn't a problem with the format on line 23
It must be something with mySQL. I checked the table. What is getting input is 0000-00-00 instead of the date I input in the form.
function set_it(){
require_once('global.inc.php');
$mysqli = new mysqli($dbhost,$dbuser, $dbpass, $dbname,$dbport);
$task =$mysqli->real_escape_string($_GET['task_todo']);
$name =$mysqli->real_escape_string($_GET['todo_name']);
$date= $mysqli->($_GET['due_date']);
isDate($date) ? $date=date("yy-m-d",time($date)); :echo "due date is not a date";exit;);
if ($mysqli->connect_error) {
printf("Connect failed:%s\n", mysqli_connect_error());
exit();
}
if($mysqli->query("INSERT INTO taskos.task(todo, name,date) VALUES('$task','$name','$date')") ){
printf("%d Row inserted.\n", $mysqli->affected_rows);
}
$mysqli->close();
}
function set_it(){
require_once('global.inc.php');
$mysqli = new mysqli($dbhost,$dbuser, $dbpass, $dbname,$dbport);
$task =$mysqli->real_escape_string($_GET['task_todo']);
$name =$mysqli->real_escape_string($_GET['todo_name']);
$date= $mysqli->($_GET['due_date']); ******
isDate($date) ? $date=date("d-m-yy",time($date)); :echo "due date is not a date";exit;);
if ($mysqli->connect_error) {
printf("Connect failed:%s\n", mysqli_connect_error());
exit();
}
if($mysqli->query("INSERT INTO taskos.task(todo, name,date) VALUES('$task','$name','$date')") ){
printf("%d Row inserted.\n", $mysqli->affected_rows);
}
$mysqli->close();
}
thankx,