I came across this page:
http://epw.e-wrestling.org/titlehistories.php
And this is what I have so far:
http://www.kansasoutlawwrestling.com/titlehistory.php
And here's my code for it:
<?php
// Connects to your Database
$link = mysql_connect("mydomain", "username", "password") or die(mysql_error());
mysql_select_db("database",$link) or die(mysql_error());
if (!mysql_select_db("database", $link)) {
echo 'Could not select database';
exit;
}
print '<table border=0 cellspacing="0" cellpadding=3 width=575>';
print '<tr><td background="images/bg_bar4.gif" height=35> <font color="white">Title Histories</font></td></tr>';
print '</table>';
print '<table border=0 cellspacing="0" cellpadding=3 width=575>';
print '<tr><td background="images/bg_bar3.gif" height=35 colspan=4> Active Titles</td></tr>';
print '<tr>';
//Define the query
$query = "SELECT * FROM titles WHERE status = 'Active'"; // Active rows
if ($r = mysql_query ($query)){ // Run the query.
while ($row = mysql_fetch_array ($r)){
print '<td><a href="titlehistory.php?id=' . $row['id'] . '" title="View KOW '.$row['titlename'].' History">';
print '<img src="/images/' . $row['titleimage'] . '" border=0 alt="View KOW '.$row['titlename'].' History" height="115px" width="115px"></a></td>';
}
} else {
die ('<p>Could not retrieve the data because <b>' . mysql_error() . '</b>. The query was $query.</p>');
} //End of query IF
print '</tr>';
print '</table>';
print '<img src=images/spacer.gif><br>';
print '<table border=0 cellspacing=0 cellpadding=3 width=575><tr><td background="images/bg_bar3.gif" height=35 colspan=2> Inactive Titles</td></tr>';
print '<tr>';
//Define the query
$query = "SELECT * FROM titles WHERE status = 'Inactive'"; // Inactive Rows
if ($r = mysql_query ($query)){ // Run the query.
while ($row = mysql_fetch_array ($r)){
print '<td><a href="titlehistory.php?id=' . $row['id'] . '" title="View KOW '.$row['titlename'].' History">';
print '<img src="/images/' . $row['titleimage'] . '" border=0 alt="View KOW '.$row['titlename'].' History" height="115px" width="115px"></a></td>';
}
} else {
die ('<p>Could not retrieve the data because <b>' . mysql_error() . '</b>. The query was $query.</p>');
} //End of query IF
print '</tr>';
print '</table>';
?>