--- etc/rtg.php.orig 2003-09-24 21:42:03.000000000 +0100 +++ etc/rtg.php 2014-06-22 15:25:22.471477252 +0100 @@ -4,10 +4,8 @@ print "\n\n
\n"; /* Connect to RTG MySQL Database */ - $dbc=@mysql_connect ($host, $user, $pass) or - $dbc=@mysql_connect ("$host:/var/lib/mysql/mysql.sock", $user, $pass) or + $dbc=@mysqli_connect ($host, $user, $pass, $db) or die ("MySQL Connection Failed, Check Configuration."); - mysql_select_db($db,$dbc); if ($PHP_SELF == "") { $PHP_SELF = "rtg.php"; @@ -37,17 +35,17 @@ # Determine router, interface names as necessary if ($rid && $iid) { $selectQuery="SELECT a.name, a.description, a.speed, b.name AS router FROM interface a, router b WHERE a.rid=b.rid AND a.rid=$rid AND a.id=$iid[0]"; - $selectResult=mysql_query($selectQuery, $dbc); - $selectRow=mysql_fetch_object($selectResult); - $interfaces = mysql_num_rows($selectResult); + $selectResult=mysqli_query($dbc, $selectQuery); + $selectRow=mysqli_fetch_object($selectResult); + $interfaces = mysqli_num_rows($selectResult); $name = $selectRow->name; $description = $selectRow->description; $speed = ($selectRow->speed)/1000000; $router = $selectRow->router; } else if ($rid && !$iid) { $selectQuery="SELECT name AS router from router where rid=$rid"; - $selectResult=mysql_query($selectQuery, $dbc); - $selectRow=mysql_fetch_object($selectResult); + $selectResult=mysqli_query($dbc, $selectQuery); + $selectRow=mysqli_fetch_object($selectResult); $router = $selectRow->router; } @@ -71,8 +69,8 @@ if (!$rid && !$iid) { echo "\n"; @@ -91,8 +89,8 @@ echo "\n"; @@ -152,8 +150,8 @@ $range="$range AND id=$iid[0]"; $selectQuery="SELECT description, name, speed FROM interface WHERE rid=$rid AND id=$iid[0]"; - $selectResult=mysql_query($selectQuery, $dbc); - $selectRow=mysql_fetch_object($selectResult); + $selectResult=mysqli_query($dbc, $selectQuery); + $selectRow=mysqli_fetch_object($selectResult); echo "Device: | $router ($rid) |
Interface: | $selectRow->name ($iid[0]) |