It's seems no one is able to answer my question.
I get the following error:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/stonedms/public_html/justin/Toplist/index.php on line 32
WHY? I have the correct SQL, and I've double checked the tables and they are the correct information.
Here is my connection code:
<?php
session_start();
$title = "MCTop";
$description = "The site to find your popular SMP needs!";
$mysql_host = "localhost";
$mysql_database = "";
$mysql_user = "";
$mysql_password = "";
mysql_connect($mysql_host, $mysql_user, $mysql_password);
mysql_select_db($mysql_database);
?>
And my index.php code:
<?php
include_once("includes/config.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><? $title; ?></title>
<meta http-equiv="Content-Language" content="English" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
</head>
<body>
<div id="wrap">
<div id="header">
<h1><? $title; ?></h1>
<h2><? $description; ?></h2>
</div>
<? include_once("includes/navigation.php"); ?>
<div id="content">
<?php
$q = "SELECT id,title,message FROM `blog` ORDER BY id DESC LIMIT 1";
$rs = mysql_query($q) or die("problem with the query: $q<br>" . mysql_error());
$extract = mysql_query($rs);
while ($row = mysql_fetch_assoc($extract))
{
echo "<div class='right'><h2>".$row['title']."</h2><div class='articles'>".nl2br(stripslashes($row['message']))."</div></div>";
}
print_r ($extract);
?>
<div class="left">
<h2>Categories:</h2>
<li><a href="#">PvP</a></li>
<li><a href="#">Spawning</a></li>
<li><a href="#"></a></li>
<ul>
</ul>
</div>
<div style="clear: both;"> </div>
</div>
<div id="footer">
<a href="http://www.templatesold.com/" target="_blank">Website Templates</a> by <a href="http://www.free-css-templates.com/" target="_blank">Free CSS Templates</a> - Site Copyright MCTop
</div>
</div>
</body>
</html>