How to select results when variable is an array

Where is this array coming from? Is it dynamically being built from external/unknown data or is it hard-coded?

If it is a list of hard-coded values, just build the sql query with the appropriate IN(1,3,4) expression.

If it is from external/unknown data, you can use FIND_IN_SET() and use a single prepared query place-holder to supply the value to the query.