mirror of
https://github.com/php/presentations.git
synced 2026-03-24 15:42:33 +01:00
13 lines
342 B
PHP
13 lines
342 B
PHP
<?php
|
|
$query_str = ''; // init query storage string
|
|
while (($row = fgetcsv($fp, 4096))) {
|
|
/* same old code ... */
|
|
|
|
// append query to query list
|
|
$query_str .= "INSERT INTO ip_ranges
|
|
(ip_start, ip_end, country_code)
|
|
VALUES({$row[0]}, {$row[1]}, {$country_id});";
|
|
}
|
|
// execute all inserts in one go
|
|
sqlite_query($query_str, sqlite_r);
|
|
?>
|