我试图找出数组中的哪些 id 已经在数据库中注册或更新。我如何自定义我的查询以添加 id 数组$ids
并进行查询以检查数组中的所有 id 如果
1- They are Registered And their visibility is 1 and their update_time > :update_time
这是代码
function GetOnlineContacts()
{
try {
$conn = $this->GetDBConnection();
$update_time = time() - 120;
$ids = array($_POST['ids']);
$statement = $conn->prepare('SELECT linkedInId FROM users WHERE update_time > :update_time AND visibility = 1');
$statement->bindParam(':update_time', $update_time, PDO::PARAM_STR);
$statement->execute();
$conn = null;
} catch(PDOException $e) {
throw $e;
}
}