wp change user role in database code example
Example: update user role wordpress
$wp_user_object = new WP_User($current_user->ID);
$wp_user_object->set_role('editor');
$wp_user_object = new WP_User($current_user->ID);
$wp_user_object->set_role('editor');