Код: Выделить всё
banid 76562577111118516 "Novxre5" "Banned IP (Recent VAC)" -1
banid 76569811108971511 "'Raiding bases'" "no reason" -1
banid 76561198011111435 "Itxxxey" "No Reason Given" -1
banid 76561198011111341 "76561119811340111" "Banned IP (Killing twice and being stupid.)" -1
banid 76561191119523558 "JuicyMexxx" "No Reason Given" -1
banid 76561111117192264 "2'" "Banned IP (Killing and Looting)" -1
banid 76561198271110021 "[ Gixos ] Banzai © ヅヅ" "Banned IP (Killing)" -1
Код: Выделить всё
$data = [
[76562577111118516, 'sChve4OUb6j3X5EVlriL0QDtMRKYHGIk', 'Imported from bans.cfg'],
[76569811108971511, 'sChve4OUb6j3X5EVlriL0QDtMRKYHGIk', 'Imported from bans.cfg'],
...
]
Код: Выделить всё
$bannedPlayers = $data;
$sql = "INSERT INTO bans (serverGroupSecretKey, playerSteamID, reason) ";
$sql .= "VALUES (?, ?, ?);";
$stmt = $pdo->prepare($sql);
$pdo->beginTransaction();
foreach ($bannedPlayers as $player) {
$stmt->execute($player);
}
$pdo->commit();
Если есть вопросы, заранее спасибо.
Подробнее здесь: https://stackoverflow.com/questions/792 ... or-strings
Мобильная версия