I couldn't think of a title, I know it's not good.
Basically, I'm going to have an array of values POSTed to me. These values will be integers.
So, let's say it will be 1,2,3,4,5 etc.. I've already figured out how to get their respective values from the database like such
$values = explode(",", $_GET['id']);
$placeholders = str_repeat('?, ', count($values) - 1) . '?';
$CheckQuery = $database->prepare("SELECT * FROM users WHERE the_id IN($placeholders)");
$CheckQuery->execute($values);
$Res = $CheckQuery->fetchAll(PDO::FETCH_ASSOC);
Now, this is great because given the IDs I want to be able to return:
ID1:0or1
ID2:0or1
I'm stuck trying to figure out how to return the IDs which do not exist in the database though. Any help here?