I am just wondering, is there any way to select data that is NOT IN array using PDO bindValue. My main purpose is to prevent SQL injection.
My query goes something like this:
$array_name = array('George', 'Bob', 'Stephanie', 'Erica');
$query = $PDO -> prepare("SELECT id FROM table WHERE name NOT IN (:array_name)")
$query->bindValue(':array_name', implode(",",$array_name), PDO::PARAM_STR);
I've tried the code above but it is not working.