I keep getting this error that my fetch arrays are not a valid resource for the two located near the bottom of my code, the ones hilighted. Can anyone see what I'm doing wrong? I'm trying to pull out entries for a simple forum, using three database tables that tie together. Thanks!
<?php
require("dbheader.php");
$topic = mysql_fetch_array(mysql_query("SELECT topic FROM topics WHERE topicid = $_GET[topicid]"));
echo(mysql_error());
$title = $topic['topic'];
$entries = mysql_query("SELECT *, UNIX_TIMESTAMP(eventTime) AS utime FROM entry WHERE topicid = $_GET[topicid]");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title><?php echo($title); ?></title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php
$entry = mysql_fetch_array($entries);
$userid = $entry['userid'];
$user = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE userid = $userid"));
$edate = date("l, F jS", $entry['utime']);
$etime = date("g:i a", $entry['utime']);
while($entry)
{
echo("<div class='display'");
echo("<table cellpadding='3' cellspacing='3'>");
echo("<tr>");
echo("<td>");
echo("<p>$user[username]</p>");
echo("<p>$edate at $etime</p>");
echo("</td>");
echo("<td>");
echo("<p>$entry[entry]</p>");
echo("</td>");
echo("</tr>");
echo("</div>");
}
?>
</body>
</html>