Can anyone figure out why variable A below works but variable B doesn't? Does the PHP look correct?
Variable A:
if( $userid = "375" ) {
role_assign( $role->id, $userid, 0, $context->id, 0, 0, 1, 'database' );
} else {
role_assign($role->id, $user->id, 0, $context->id, 0, 0, 0, 'database');
}
Variable B:
if( $role->id == "14" ) {
role_assign( $role->id, $userid, 0, $context->id, 0, 0, 1, 'database' );
} else {
role_assign($role->id, $user->id, 0, $context->id, 0, 0, 0, 'database');
}