PHP
- 19 ответов
- 0 вопросов
14
Вклад в тег
$ids = [963, 963, 70];
$inQuery = implode(',', array_fill(0, count($ids), '?'));
$stmt = $db->prepare('
SELECT `id` FROM `article` WHERE id IN(' . $inQuery . ')
');
foreach ($ids as $k => $id)
$stmt->bindValue(($k+1), $id, \PDO::PARAM_INT);
$stmt->execute();
$allResult = $stmt->fetchAll();