Running a custom wordpress table to store notices to display to each individual site, I then store the dismissed notices as an option in the site's options table as a list (ie. 3,9,28,22)
Then, when loading the site I need to retrieve the site's notices excluding the ones already dismissed.
SELECT
*
FROM
be_notices as notice
WHERE
notice.id NOT IN ( SELECT option_value FROM wp_26_options WHERE option_name = 'be_dismissed_notices' )
The problem being it retrieves all the notices as expected, but excludes only the first number/id in the comma-separated list. If I put NOT IN (3,8) hardcoded it works. But that's exactly the value found in option_value so I am confused.
Any idea why it only excludes the first ID and not the second/other one(s)?