I am trying to use the wpdb->update() function to update a row in a database that has a custom PRIMARY KEY. Here is my wpdb->update() code:
$column => $value
‘observation_id’ => $observation_id
array( ‘%d’ )
but I am getting the PHP error:
WordPress database error Unknown column ‘id’ in ‘where clause’ for query UPDATE
Am I missing something? In the 3rd argument for update() I am specifying to search by “observation\_id” and not “id”. Does WordPress automatically force searching by “id” under the hood?
This is part of a custom rest\_route, which I am hitting with the AJAX Query:
The weird thing is that upon refreshing the page, the value pulled from the database is the updated value sent over the rest endpoint, but the AJAX response gives a \`parsererror\`.
Thank you for your help!