So I have a database table in wordpress that has a list of current live
orders and I want to update a certain order. The table name is wp_order_infomation
the primary key is order_id
and the column I want to update is order_status
. I want to change the value of order_status from live
to canceled
.
This is the code I am using but it doesn't change anything. Am I using it correctly?
<?php
$where = array('order_id' => '39');
$data = array('order_status' => 'canceled');
global $wpdb;
$table_name = $wpdb->prefix."wp_order_infomation";
$wpdb->update($table_name, $data, $where);
?>