diff --git a/html/includes/graphs/port/fanspeed.inc.php b/html/includes/graphs/port/fanspeed.inc.php
deleted file mode 100644
index 361720e45..000000000
--- a/html/includes/graphs/port/fanspeed.inc.php
+++ /dev/null
@@ -1,22 +0,0 @@
-
\ No newline at end of file
diff --git a/html/includes/graphs/port/pagp_bits.inc.php b/html/includes/graphs/port/pagp_bits.inc.php
index f34e5012e..b33ce2422 100644
--- a/html/includes/graphs/port/pagp_bits.inc.php
+++ b/html/includes/graphs/port/pagp_bits.inc.php
@@ -2,10 +2,8 @@
## Generate a list of ports and then call the multi_bits grapher to generate from the list
-$query = mysql_query("SELECT * FROM `ports` WHERE `device_id` = '".$port['device_id']."' AND `pagpGroupIfIndex` = '".$port['ifIndex']."'");
-
$i=0;
-while ($int = mysql_fetch_assoc($query))
+foreach(dbFetchRows("SELECT * FROM `ports` WHERE `device_id` = ? AND `pagpGroupIfIndex` = ?", array($port['device_id'], $port['ifIndex'])) as $int)
{
if (is_file($config['rrd_dir'] . "/" . $hostname . "/port-" . safename($int['ifIndex'] . ".rrd")))
{
@@ -27,4 +25,4 @@ $rra_out = "OUTOCTETS";
include("includes/graphs/generic_multi_bits_separated.inc.php");
-?>
\ No newline at end of file
+?>