$mysqli = mysqli_connect('localhost', '***', '***', '***') or die('Error1!');
mysqli_set_charset($mysqli, 'utf8');
$sql = 'INSERT IGNORE page (url) VALUES ';
foreach ($all_articles_links as $value) {
$sql .= "('http://minecraft.gamepedia.com" . $value . "'), ";
}
$sql = rtrim($sql, ", ");
mysqli_query($mysqli, $sql) or die('Error2!');
в соответствующий аналог на PDO ? <?php
$db = new PDO('mysql:host=localhost;dbname=test', 'root', 'root', [PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8"]);
$stmt = $db->prepare("INSERT IGNORE INTO page (url) VALUES (?)");
$stmt->bindParam(1, $url);
$links = [
'url1',
'url2',
'url3',
];
foreach ($links as $link) {
$url = "$link/add";
$stmt->execute();
}