MySQL IN array only processes its first value

QuestionsMySQL IN array only processes its first value
sethbeckerman5 Staff asked 4 years ago

I am programmatically creating a PDO statement using PHP.
The PDO prepared statement is:

Where the variable content in the array are integers.
The first is a single integer. The second are integers in an array, so I am imploding them to the string that would normally fit in the array.
So the full deal is:

The issue seems to be that the SQL only processes the FIRST of the integer IDs that are inserted in the array. Any ID matching one of the integers in the array should be changed.
If I run the SQL in the SQL tool on my server like this:

It works, and I get all IDs that were 1, 2, or 3 changed to 5.
But my PDO version changes only the 1s to 5s. 2s and 3s are left the same.
Any thoughts?


View on Stack Overflow