Change user roles based on profile field I have an field role_type with values - 0,1,2...

And I need to add role X to all users who have role_type = 2?

How can I do that? Rules? SQL? 

Thanks for your help.
I think you could write a little module.


db_select() all users with that role_type entry
user_load() them and user_save() them with updated $user-&gt;roles[]


Maybe this thread HOWTO assign a user to a role programatically on drupal.org can give you a deeper insight.