update query in wordpress using $wpdb code example
Example 1: update query wordpress
global $wpdb;
$dbData = array();
$dbData['last_login_time'] = time();
$wpdb->update('table_name', $dbData, array('user_id' => 1));
Example 2: update wordpress query
$wpdb->query($wpdb->prepare("UPDATE $table_name SET time=$current_timestamp WHERE userid=$userid"));