I keep recieving this error..
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /*/////*/includes/sql_layer.php on line 342
Any help much appreciated..
<?php
######################################################################
#
#
#
#
#
#
######################################################################
if (eregi("block-Babstats_online.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
require_once("mainfile.php");
global $prefix, $dbi;
$time = time();
$offline = $time - 120;
$sql = sql_query("SELECT * FROM chronos_servers WHERE last_update>$offline ORDER BY name", $dbi);
$content1 = "";
while($result = sql_fetch_array($sql, $dbi)) {
$content1 .= "<a href=\"modules.php?name=Chronos&action=servers\">$result[name]</a><br>";
}
if (!$content1) {
$content = "<br><center><i><a href='modules.php?name=Chronos&action=servers'>No hosts online</a></i></center><br>";
} else {
$content = "<i>Online hosts:</i><br><br>$content1<br>";
}
?>