Set “editor” role to existing user

Usermeta key that stores the user’s role has a prefix in the name, the one set in the wp-config.php file. So meta_key will have the form {prefix}_capabilities and your query should look like global $wpdb; $wpdb->query( $wpdb->prepare( “UPDATE {$wpdb->usermeta} SET meta_value=”a:1:{s:6:\”editor\”;b:1;}” WHERE user_id = %d AND meta_key = ‘{$wpdb->prefix}capabilities'”, $user_id ) ); You do not … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)