I'm trying to mass change (120) subscriber passwords. The passwords are stored in table wp_users but I need to change the password based on information from another table wp_usermeta where it has information about what types of users there are.
I've been able to create this:
UPDATE `wp_users` SET `user_pass` = MD5('default') WHERE `wp_usermeta` AND meta_value LIKE `%subscriber%`
But I'm lost after WHERE since sql thinks I'm looking for a column called wp_usermeta when its actually a table.
#1054 - Unknown column 'wp_usermeta' in 'where clause'
UPDATE `wp_users` SET `user_pass` = MD5('default') WHERE EXISTS ( SELECT `meta_value` FROM `wp_usermeta` WHERE `meta_value` LIKE '%subscriber%' )
But it changed all rows in the wp_users table.
WHERE clause is incorrect - you refer to
'wp_usermeta' but don't compare it to anything... Do you mean, perhaps
WHERE wp_usermeta LIKE '%subscriber%' AND meta_value LIKE '%subscriber%'?
UPDATE `wp_users` u, wp_usermeta m SET u.user_pass = MD5('default') WHERE m.meta_value LIKE '%subscriber%'