Here is the code in it's entirety -
<!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" xml:lang="en" lang="en">
<head>
<style type="text/css">
</style>
<meta name="author" content="James Johnson - J-Squared Software 2009" />
<meta http-equiv="content-type" content="text/html;charset=iso-8859-2" />
<link rel="stylesheet" href="images/news_style.css" type="text/css" />
<title>LeagueSQL - Index</title>
</head>
<body>
<div class="content">
<div class="header_right">
<div class="top_info">
<div class="top_info_right">
<a href="admin.php">Admin Login</a>, <a href="mod_login.php">Moderator Login</a> or <a href="blogger_panel.php">Blogger Login</a>
</div>
</div>
<div class="bar">
<ul>
<li><a href="#" accesskey="a">Home</a></li>
<li><a href="news.php" accesskey="b">News</a></li>
<li class="active">Results</li>
<li><a href="#" accesskey="p">Upload Videos</a></li>
<li><a href="#" accesskey="g">Upload Images</a></li>
</ul>
</div>
</div>
<div class="logo">
<h1><a href="index.php" title="J-Squared Software">League<span class="red">SQL</span></a></h1>
<p>Competetive Gaming, Made Easier.</p>
</div>
<div class="search_field">
<!-- SQL Populated Drop Down -->
<form method="post" action="showleague.php">
<span class="search">Select a league:</span>
<select name="leagueName">
<?php
error_reporting(E_ALL);
//Connect & Select.
$con = mysql_connect("localhost","=(","=(");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("jsoftwa1_LeagueSQL", $con);
$result = mysql_query("SELECT LeagueName FROM League_Index");
while ($data=mysql_fetch_assoc($result)){
?>
<option value ="<?php echo $data['LeagueName'] ?>" ><?php echo str_replace('_', ' ', $data['LeagueName']) ?></option>
<?php } ?>
</select> <input type="submit" value="view" class="button" />
</form>
</div>
<div class="newsletter">
<p>
</p>
</div>
<div class="subheader">
<p>- THIS PAGE IS UNDER CONSTRUCTION -</p>
</div>
<div class="left">
<div class="left_articles">
<!-- News Header -->
<p>
<h1><a href="#" title="J-Squared Software"><span class="red">League</span>News</a></h1><h5>The latest news brought to you by BBF's own bloggers.</h5>
</p>
<!-- News Header End -->
</div>
<!-- Left Blog --><!--
<div class="lt"></div>
<div class="lbox"><h2>Title</h2><div class="thumb"><img src="images/flickr.png" alt="Article Image" /><p>Caption</p></div><p>Insert text here...</p></div> -->
<!-- PHP Auto-blog -->
<?php
$con = mysql_connect("localhost","=)","=)");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("jsoftwa1_LeagueSQL", $con);
// Code to display the results.
$result = mysql_query("SELECT * FROM Result_Log ORDER BY resultID DESC");
while ($row=mysql_fetch_assoc($result))
{
print_r($row);
}
/*Test Query
echo mysql_num_rows($result);
Query returns the expected value.*/
/*
while ($row=mysql_fetch_assoc($result));
{
// Set variables.
$leagueName = $row['League'];
$results = $row['Result'];
$comments = $row['Comment'];
$timestamp = $row['Timestamp'];
$var = mysql_query("SELECT * FROM League_Index WHERE LeagueName = '$leagueName' LIMIT 1");
$img_row = mysql_fetch_assoc($var);
$image = $img_row['Image'];
// Debug code.
echo $leagueName;
echo $results;
echo $comments;
echo $timestamp;
echo $image;
echo $result; // ...is showing as 'Resource id #3'.
// Echo HTML string.
echo ('<div class="lt"></div><div class="lbox"><h2>'.$leagueName.'</h2><div class="thumb"><img src="'.$image.'" alt="Article Image" /><p>'.$timestamp.'</p></div><p>'.$results.'<br /><br />'.$comments.'</p></div>');
} */
?>
<a href="#">Click to view more...</a>
</div>
<!-- Web 2.0 -->
<div class="right">
<br />
<br />
<br />
<br />
<br />
<br />
<div class="rt"></div><div class="right_articles">
<p><h3>LeagueSQL Snapshots</h3></p>
<p>To save you having to view each individual league, here are the top 3 players from each active league!</p>
</div>
<!-- Recent Results Feed -->
<?php
// Code to display top 3 of each league.
mysql_close($con);
?>
</div>
<div class="footer">
<a href="#">RSS Feed</a> | <a href="#">Contact Us</a> | <a href="#">Advertising</a> | <a href="#">Credits</a> | <a href="#">Donate</a><br />
© Copyright 2009 LeagueSQL - J.Squared Software
</div>
</div>
</body>
</html>