I've got the following code:
function disp_forums() {
initdb();
$query = "SELECT id, name, description FROM gfforums ORDER BY id DESC";
$get = mysql_db_query($sqldb, $query);
while ($row = mysql_fetch_object($get)) {
echo "<font size=2><b>";
echo "<a href=/?forumid=$row->id>";
echo $row->name;
echo "</a><br>";
echo "</b><font size=1>";
echo $row->description;
echo "<p>";
}
mysql_free_result($get);
closedb();
}
disp_forums();
when I simply run the code within the function apart from any sort of function, it works fine. When I stick it in a function and call that function, I get that $get is not a valid MySQL result resource.
Any ideas?