in reply to SQL prepared statements using MySQL In ()

I expect you need to make values be a list, and do something like this:

my @values = ( 1,2,3,4,5 ); my $placeholders = join( ',', ('?') x scalar @values ); my $query = "SELECT field1 FROM table1 WHERE field2 IN ( $placeholders )";
Your prepare and execute calls should then work correctly.

You example is providing a single variable, so I guess DBI is not interpreting "1,2,3,4,5" as a list.

Alex / talexb / Toronto

Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.