In filtering out some spam, I have two MYSQL statements in one file,
SET @valid_users := '"admin", "jrock", "kmicka", "First Last"'; //etc
Followed by a SELECT like this
SELECT /*stuff*/ /*WHERE*/ /*filters*/ AND User.user_name NOT IN (@valid_users)
When I do this, it acts as if @valid_users
is an empty string. (Returns all results). But if I change the clause to NOT IN ('admin', 'jrock', etc)
then it works as it should.
Why would a variable in the NOT IN
filter not work?