my code:
$newElements=json_encode([‘name’=>’jorge’,’age’=>23]);
mysqli_query($db, “UPDATE dl SET data=json_replace(data, ‘$.list’, cast(‘$newElements’ as json)) WHERE id = ‘$ID’ “)
my Error:
Fatal error: Uncaught mysqli_sql_exception: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘json)) WHERE id = ‘8451’…
That my list of: [‘name’ => ‘jak’, ‘age’ => 13] let it be: [‘name’ => ‘jorj’, ‘age’ => 21]
Also, what should I do to make it like this: That my list of: [‘name’ => ‘jak’, ‘age’ => 13] let it be: [[name’ => ‘jorj’, ‘age’ => 21],
[‘name’ => ‘jorj’, ‘age’ => 21]]
Also, what should I do to make it like this: That my list of: [‘name’ => ‘jak’, ‘age’ => 13] let it be: [[‘name’ => ‘jorj’, ‘age’ => 21],[name’ => ‘jorj’, ‘age’ => 21]]
mezerji مزرجی is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.