Instead of merely curing the symptom, let me offer a different approach.
You should probably not store your information in the table like that. It should be possible to let the database figure out, if some product is hidden or not. For that, you need to normalize your data properly.
Apparently, you have a table of products somewhere and some should be hidden. If this is a property true
or false
that belongs to every product, you can just add it to the your products table as a new column.
SELECT id FROM products WHERE id = 2 AND hidden = 1
If hidden
is not an intrinsic property of your products, you can also create a helper table that is simply a list of product IDs.
An entry simply says that the product is hidden. If an ID is absent from the table, it's not hidden.