Page 1 of 1

Won't Correctly Link

Posted: Thu Aug 14, 2008 10:02 am
by CoolAsCarlito
I have my titlehistory.php page and of course when you click on each titles pic you go to that titles info which is found by having to go to http://kansasoutlawwrestling.com/titlehistory3.php just to see one of the titles info as an example.

But I want the link titlehistory.php?id=whatever to actually only pull up that titles info if that makes sense.

titlehistory.php

Code: Select all

 
<?php
 
// Connects to your Database
$link = mysql_connect("?", "?", "?") or die(mysql_error());
mysql_select_db("?",$link) or die(mysql_error());
 
if (!mysql_select_db("?", $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>&nbsp;<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>&nbsp;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>&nbsp;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>'; 
?>
 

Titlhistory3.php

Code: Select all

 
<?php echo "<body bgcolor=\"black\" link=\"red\" vlink=\"red\">"; ?>
 
<?php
// Connects to your Database
$link = mysql_connect("?", "?", "?") or die(mysql_error());
mysql_select_db("?",$link) or die(mysql_error());
 
if (!mysql_select_db("?", $link)) {
echo 'Could not select database';
exit;
}
 
//Define the query
$query = "SELECT *, DATE_FORMAT(`datecreated`, '%M %e, %Y') as datecreated FROM titlehistory";
 
if ($r = mysql_query ($query)){ // Run the query. 
    while ($row = mysql_fetch_array ($r)){
 
print '<table border=0 cellspacing="0" cellpadding=3 width=575>';
print '<tr><td background="images/bg_bar4.gif" height=35>&nbsp;<font color="white">Title Histories</font></td></tr>';
print '<tr><td></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=2><font color=red>&nbsp;KOW '.$row['titlename'].'</font></td></tr>';
print '<tr><td width=200><img src="/images/' . $row['titleimage'] . '" width=208px height=156px border=0 alt="View KOW '.$row['titlename'].' History"></td><td valign=top>';
print '<table cellpadding="2" cellspacing="0" border="0" width=100%>';
print '<tr><td align=center bgcolor=#E0E0E0><b>Date Created</b></td></tr><tr><td align=center><font color=white>'.$row['datecreated'].'</font></td></tr>';
print '<tr><td bgcolor=#E0E0E0 align=center><b>Status</b></td></tr>';
print '<tr><td align=center><font color=white>'.$row['status'].'</font></td></tr>';
print '<tr><td bgcolor=#E0E0E0 align=center><b>Longest Reign</b></td></tr>';
print '<tr><td align=center><a href=bio.php?'.$row['longestreign'].'><b>'.$row['longestreign'].'</b></a> <font color=white>('.$row['numdays'].')</font></td></tr>';
print '<tr><td bgcolor=#E0E0E0 align=center><b>Most Successful Defenses</b></td></tr>';
print '<tr><td align=center><a href=bio.php?'.$row['sucessdefenses'].'><b>'.$row['sucessdefenses'].'</b></a> <font color=white>('.$row['numdef'].')</font></td></tr>';
print '</table></td></tr></table>';
print '<img src=images/spacer.gif><br />';                                                  
print '<table cellpadding="2" cellspacing="0" border="0" width=100%>';
print '<tr>';
print '<td valign=top align=center width=115><a href="bio.php?'.$row['wrestlername'].'" title=View History for '.$row['wrestlername'].'>';
print '<img src="/images/' . $row['wrestlername'] . '" border=0 alt=View History for '.$row['wrestlername'].' height=115 width=115></a></td>';                                                      print '<td valign="top" width=100%>';
print '<table border=0 width=100% cellspacing=1 cellpadding=2>';
print '<tr>';
print '<td background="images/bg_bar4.gif" bgcolor=#E0E0E0 align=center width="25"><b>8</b></td>';
print '<td background="images/bg_bar3.gif" bgcolor=#E0E0E0><b>&nbsp;Jesse Jamester</b></td>';
print '</tr>';
print '</table>';
print '<table border=0 width=100% cellspacing=1 cellpadding=2>';
print '<tr>';
print '<td bgcolor=#E0E0E0 align=center width="50%"><font class=small><b>Successful Defenses</b></font></td>';
print '<td bgcolor=#E0E0E0 align=center><font class=small><b>Event</b></font></td>';
print '</tr>';
print '<tr>';
print '<td align="center"><font class=small>1</font></td>';
print '<td align="center"><font class=small><a href=/aggression/results.php?id=1214611200&view=chapter&page=18><b>Friday Aggression</b></a></font></td>';
print '</tr>';
print '<tr>';
print '<td bgcolor=#E0E0E0 align=center><font class=small><b>Reign</b></font></td>';
print '<td bgcolor=#E0E0E0 align=center><font class=small><b>Date Won</b></font></td>';
print '</tr>';
print '<tr>';
print '<td align="center"><font class=small>0 Days</font></td>';
print '<td align="center"><font class=small>June 27, 2008</font></td>';
print '</tr>';
print '<tr>';
print '<td colspan="2"><font class=small><i>Title won in a singles match against John "The Prophet" Adams.&nbsp;</i></font></td>';
print '</tr>';
print '</table>';
print '</td>';
print '</tr>';
print '</table>';
}
 
} else {
die ('<p>Could not retrieve the data because <b>' . mysql_error() . '</b>. The query was $query.</p>');
} //End of query IF  
?>