Doing a website for local history society and need a page for them to update the agenda list. Even a very simplified line doesn't work:
$sql = $con->query("UPDATE whlist SET date='$date' WHERE id='$id'");
if ($con->query($sql) <> TRUE) {echo $con->error;}
Getting:
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 '1' at line 1
Echo shows all valid values. Tried variations, id=1, enclosing in quotes as per some online stuff. I've used much more complicated update lines in other code with no problem and can't see what's wrong here. Any ideas? Cheers.
$sql = $con->query("UPDATE whlist SET date='$date' WHERE id='$id'");
if ($con->query($sql) <> TRUE) {echo $con->error;}
Getting:
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 '1' at line 1
Echo shows all valid values. Tried variations, id=1, enclosing in quotes as per some online stuff. I've used much more complicated update lines in other code with no problem and can't see what's wrong here. Any ideas? Cheers.
Comment