From c9b4dd42d1c3d431e1ffa527c9c899544d57ce8b Mon Sep 17 00:00:00 2001 From: twa127 <46624596+twa127@users.noreply.github.com> Date: Tue, 16 Mar 2021 22:18:00 +0000 Subject: [PATCH] Update index.php --- index.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/index.php b/index.php index b6ca913..4562333 100755 --- a/index.php +++ b/index.php @@ -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'); }