here is what my database looks like:
database -> thoughts
table -> thoughts
fields -> thoughtsID (K, auto-increment), date (text), title (text), thoughts (memo)
my UPDATE statement looks like this:
(in browser):
UPDATE thoughts SET date='2122004', title='my birthday', thoughts='That was my birthday
(in PHP):
// if this is a current record that was edited, then we do
// NOT want to create another record with the same data
if($_POST['id']) {
$i = $_POST['id'];
$query = "UPDATE thoughts SET date='$date', title='$title', thoughts='$thoughts' WHERE thoughtsID='$i'";
} else {
$query = "INSERT INTO thoughts([date], [title], [thoughts]) ";
$query .= "VALUES('$date', '$title', '$thoughts')";
}
the error being printed to the browser is:
Warning: odbc_exec(): SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement., SQL state 37000 in SQLExecDirect in f:\programs\servers\apache\websites\ddott\write2.php on line 67
[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.
This is driving me absolutely nuts, as I am using Access 2000 because I couldn't get MySQL installed and working on my WindowsXP Professional box here at home.