I\'m using PDO to execute a statement with an IN
clause that uses an array for its values:
$in_array = array(1, 2, 3);
$in_values = implode(\',\'
As I understand it it is because PDO will treat the $in_values contents as a single item and will quite it accordingly. PDO will see 1,2,3 as a single string so the query will look something like
SELECT * FROM table WHERE my_value IN ("1,2,3")
You may think that changing the implode to have quotes and commas will fix it, but it will not. PDO will see the quotes and change how it quotes the string.
As to why your query matches the first value, I have no explanation.