I am trying to select id's from a table by passing a string with multiple id's comma separated.
how would i query the below to allow passing multiple id's and using the prepare statement
set @string = ('1,2,3,4,5,6,7,10'); <- the string passed into the procedure
PREPARE stmt2 FROM 'SELECT id from customers where id in (?)';
SET @a = @string;
EXECUTE stmt2 USING @a;
DEALLOCATE PREPARE stmt2;
currently returns only 1 row, which is the first value of @string, is it possible to either loop through the @string values and query my stmnt with them?