Does anyone know if it's possible to use prepared statements with the IN clause in PDO (or any engine for that matter)?
What I would like to be able to do is something like the following.
// $db is a PDO object
$stmt = $db->prepare("SELECT * FROM mytable WHERE id IN (?)");
$stmt->execute(
array( // Array of parameters
array( 1, 2, 3, 4, 5) // Parameter as an array because IN can have multiple terms
)
);
Unfortunately this doesn't work.
Ayone got any ideas?
Cheers
Rob