December 06, 2012
Block user accounts via database operation
I've had problems where I want to block a 100 or more user accounts at once. This leads to a Drupal memory error. To avoid the error you need to block accounts 5 or so at-a-time (working off the admin/user/user page).
This SQL can be used to block a lot of accounts at once based on role.
LEFT JOIN drupal_users_roles ON drupal_users.uid = drupal_users_roles.uid
SET drupal_users.status = 0
WHERE drupal_users_roles.rid = 8
Posted by kkwaiser at December 6, 2012 10:06 AM