Well the problem seems to be, you have a column name incorrect.

/set %query select * FROM phpbb_users WHERE userid = '2'
Here you have "userid"

/set %query SELECT * FROM phpbb_users WHERE user_id = 2
Here you have "user_id"

I doubt the same table has both columns like that. I'd suggest you verify the column names then try again.