After this question,I run below script:
$newrecord='{"firsttime":"19.53","secondtime":null,"sX464time":"6.25","wX1X465time":"4.14"}';//JSON
$sql='UPDATE `'.$tablesnames[$i].'` SET `postrecords`='.$newrecord.' WHERE `id`='.$id;
//var_dump($sql) here
$update3=$pdo->exec($sql);
var_dump($sql)
get result:
string 'UPDATE `table651` SET `postrecords`={"firsttime":"19.53","secondtime":null,"sX464time":"6.25","wX1X465time":"4.14"} WHERE `id`=1'
But finally get warning:
Warning: PDO::exec(): 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 '"firsttime":"0","secondtime":null,"sX464time":null
What's the problem?