CREATE TABLE Cities (
id int primary key auto_increment,
city varchar(64)
);
CREATE TABLE CityDistnce (
city1 int,
city2 int,
distance int,
foreign key (city1) references Cities(id),
foreign key (city2) references Cities(id),
index (city1, city2)
);
...
require_once($_SERVER['DOCUMENT_ROOT'].'\Extension\phpexcel\PHPExcel\IOFactory.php');
$excel = \PHPExcel_IOFactory::load("$temp_dir/$file");
$arr = $excel->getActiveSheet()->toArray(null,true,true,true);
foreach ($arr as $key => $value) {
$tab_num = $value["B"];
...