How to assign role with PHP in Drupal?
问题 I need to assign a kind of "premium status" to members that purchase an amount equal or greater than 100 € via PHP. Conditional Actions are already set up (user = anonymous/authenticated AND total amount = equal/greater than 100 AND user =! premium) but I'm missing the PHP part to actually say "then grant him the premium membership". How can I achieve this? EDIT: is the below code correct? if ($account) { $uid = $account->uid; $role_name = 'authenticated user'; $rid = db_result(db_query(