I’m trying to copy info from Buddypress to WordPress. This query works in PHPMyAdmin, but it doesn’t work in WordPress:
UPDATE wp_users SET display_name=”displayname2222″ WHERE ID=96 (This works in PHPMyAdmin)
$wpdb->query(‘UPDATE wp_users SET display_name=”displayname2222″ WHERE ID=96’); (This sets the display_name field to blank)
I’m usually using values from variables, but I’m hard-coding for testing.
Anybody know if WordPress blocks access to update wp_users or what else might be causing this problem?
WordPress version is 3.1.1-RC1
Thanks for any help!
Ok, I figured it out. I modified /wp-includes/wp-db.php to echo all the queries. I then searched those for “UPDATE wp_users” and found that something was setting display_name to blank after my plugin sets it to a value. So I set the priority of the add_action that calls my function to 20, and that causes it to run after that other thing runs. The value is now set properly.