You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
should error, as a sql error occurs when ids is an empty-array.
// should errorfunctioninIDs(array$ids) {
$pdo->query('SELECT email FROM ada WHERE adaid IN('. implode(',', $ids) .')', PDO::FETCH_ASSOC);
}
// should errorfunctioninIDs(array$ids) {
$stmt = $pdo->prepare('SELECT email FROM ada WHERE adaid IN(?)');
$stmt->execute([implode(',', $ids)]);
}
// fine/** @param non-empty-array $ids */functioninIDs(array$ids) {
$pdo->query('SELECT email FROM ada WHERE adaid IN('. implode(',', $ids) .')', PDO::FETCH_ASSOC);
}
The text was updated successfully, but these errors were encountered:
should error, as a sql error occurs when
ids
is an empty-array.The text was updated successfully, but these errors were encountered: