I have this pre-existing table structure (yes data and time are terrible names but they are already there):
However everything grinds to a halt on updating the in/out field. (Also tried with prepared statements: no luck)
This does not work:
$update_punch = $conn->query("UPDATE ttime SET date='$the_edited_date_w_mysql', time='$the_edited_time', inout='$the_ins_and_outs' WHERE id='$the_id' LIMIT 1");
The first line of this works but it chokes on the 2nd (chocks with inout being a var or 'in':
$update_punch = $conn->query("UPDATE ttime SET date='$the_edited_date_w_mysql', time='$the_edited_time' WHERE id='$the_id' LIMIT 1");
$update_punch = $conn->query("UPDATE ttime SET inout='$the_ins_and_outs' WHERE id='$the_id' LIMIT 1");
Here is there error:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 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 'inout='out' WHERE id='171366' LIMIT 1' at line 1' in /site/updatepunchesbystore2.php:43 Stack trace: #0 /site/updatepunchesbystore2.php(43): PDO->query('UPDATE ttime SE...') #1 {main} thrown in /site/updatepunchesbystore2.php on line 43
I have fought with it for an hour and I'm stumped!
Any thoughts?