If I have a setup such as:
set @idToIgnore = (select user_id from user_field_value where user_field_id = 82 and value = 'No';
select id from users where account_id = 10 and id != @idToIgnore;
insert into user_field_value(user_id, user_field_id, value) values (**user_id**, 82, 'Yes');
Why not just do that in one
INSERT INTO ... SELECT ... query?
INSERT INTO user_field_value(user_id, user_field_id, value) SELECT id, 82, 'Yes' FROM users WHERE account_id = 10 and id != @idToIgnore;
You can also do the whole thing in one query using subquery instead of
@idToIgnore, but be careful in the matter of performance.