Question
Problem with update record (PHP/My SQL)
Can anyone help me figure this one out.
I have a form which contains two text areas 'start-date' and 'finish-date'. Ideally when filled in with a date (eg 2009-03-16 they will update the relevant records in the database (MySQL 'date' fields).
This is the code I have a the moment
******************************************************************************************
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "frm_editdate")) {
$updateSQL = sprintf("UPDATE dates08 SET start-date=%s, finish-date=%s WHERE id=%s",
GetSQLValueString($_POST['start-date'], "date"),
GetSQLValueString($_POST['finish-date'], "date"),
GetSQLValueString($_POST['id'], "int"));
******************************************************************************************
But when I submit the form I get this message:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-date='2009-01-30' WHERE id=2679' at line 1
I've tried everything I can think of but I can't get it to work.
I have a form which contains two text areas 'start-date' and 'finish-date'. Ideally when filled in with a date (eg 2009-03-16 they will update the relevant records in the database (MySQL 'date' fields).
This is the code I have a the moment
******************************************************************************************
if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "frm_editdate")) {
$updateSQL = sprintf("UPDATE dates08 SET start-date=%s, finish-date=%s WHERE id=%s",
GetSQLValueString($_POST['start-date'], "date"),
GetSQLValueString($_POST['finish-date'], "date"),
GetSQLValueString($_POST['id'], "int"));
******************************************************************************************
But when I submit the form I get this message:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-date='2009-01-30' WHERE id=2679' at line 1
I've tried everything I can think of but I can't get it to work.
