From 7e5c50603cbe1307d68a2b5b8ee14409e15a9dcb Mon Sep 17 00:00:00 2001 From: Matthijs Kuiper Date: Sun, 14 Jan 2018 20:08:50 +0100 Subject: Update to mysqli --- html/pages/admin/pinfo.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'html/pages/admin/pinfo.php') diff --git a/html/pages/admin/pinfo.php b/html/pages/admin/pinfo.php index 3ae57f7..cf04b3d 100644 --- a/html/pages/admin/pinfo.php +++ b/html/pages/admin/pinfo.php @@ -1,6 +1,6 @@ '; $sql_ips = "SELECT INET_NTOA(p.ip) AS ip, COUNT(p.id) AS matches, MIN(m.time) AS first, MAX(m.time) AS last FROM uts_player AS p, uts_match AS m WHERE p.pid = ".$pid." AND m.id = p.matchid GROUP BY ip ORDER BY ip"; -$q_ips = mysql_query($sql_ips) or die("Can't get ip's: " . mysql_error()); +$q_ips = mysqli_query($GLOBALS["___mysqli_link"], $sql_ips) or die("Can't get ip's: " . mysqli_error($GLOBALS["___mysqli_link"])); echo ' @@ -32,14 +32,14 @@ echo ' - + '; -while ($r_ips = mysql_fetch_assoc($q_ips)) { - echo ' +while ($r_ips = mysqli_fetch_assoc($q_ips)) { + echo ' @@ -55,10 +55,10 @@ echo '
* Hostnames are real time and might have been different at the time of playing. *

'; -mysql_free_result($q_ips); +((mysqli_free_result($q_ips) || (is_object($q_ips) && (get_class($q_ips) == "mysqli_result"))) ? true : false); $sql_fakes = "SELECT INET_NTOA(p1.ip) AS ip, pi.name FROM uts_player AS p1, uts_player AS p2, uts_pinfo AS pi WHERE p1.pid = ".$pid." AND p1.ip = p2.ip AND p1.pid <> p2.pid AND pi.id = p2.pid GROUP BY pi.name"; -$q_fakes = mysql_query($sql_fakes) or die("Can't retrieve fake nicks: " . mysql_error()); +$q_fakes = mysqli_query($GLOBALS["___mysqli_link"], $sql_fakes) or die("Can't retrieve fake nicks: " . mysqli_error($GLOBALS["___mysqli_link"])); echo '
IPHostnameHostname Matches First Last
'.$r_ips['ip'].' '.gethostbyaddr($r_ips['ip']).'
@@ -70,14 +70,14 @@ echo ' '; -if (mysql_num_rows($q_fakes) == 0) { +if (mysqli_num_rows($q_fakes) == 0) { echo ' '; } else { - while($r_fakes = mysql_fetch_assoc($q_fakes)) { + while($r_fakes = mysqli_fetch_assoc($q_fakes)) { echo ' -- cgit
IP
No other names found
'.$r_fakes[ip].'