Skip to content

Commit

Permalink
Update index.php
Browse files Browse the repository at this point in the history
  • Loading branch information
twa127 authored Mar 16, 2021
1 parent 20be8b3 commit c9b4dd4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,12 @@
$result = $conn->query($query);
}
} else {
$rowSQL = mysql_query( "SELECT MAX( interface_num ) AS max_interface_num FROM `network_settings`;" );
$row = mysql_fetch_array( $rowSQL );
$max_interface_num = $row['max_interface_num'] + 1;
$query = "INSERT INTO network_settings(sync, purge, primary_interface, ap_mode, interface_num, interface_type, mac_address, hostname, ip_address, gateway_address, net_mask, dns1_address, dns2_address) VALUES ('0', '0', '0', '1', '{$max_interface_num}', 'wlan0', '', '', '', '', '', '', '');";
$result = $conn->query($query);
$query = "SELECT MAX( interface_num ) AS max_interface_num FROM `network_settings`;";
$result = $conn->query($query);
$row = mysqli_fetch_array($result);
$max_interface_num = $row['max_interface_num'] + 1;
$query = "INSERT INTO `network_settings`(`sync`, `purge`, `primary_interface`, `interface_num`, `interface_type`, `mac_address`, `hostname`, `ip_address`, `gateway_address`, `net_mask`, `dns1_address`, `dns2_address`, `ap_mode`) VALUES ('0', '0', '0', '{$max_interface_num}', 'wlan0', '', '', '', '', '', '', '', '1');";
$result = $conn->query($query);
}
redirect_to('index.php');
}
Expand Down

0 comments on commit c9b4dd4

Please sign in to comment.