Then this is the main file that displays the results (I haven't worked on it too much).
PHP Code:
<?php
require('./global.php');
include ("mainfile.php");
$index = 1;
global $menu_id,$menu,$Pmenu,$activeusers;
$Pmenu="P_thememenu_homepage";
include("header.php");
?>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#333D4D" width="100%">
<tr>
<td width="100%" bgcolor="f5f5f5">
<div align="center">
<center>
</center>
</div>
<div align="center">
<center>
</center>
</div>
<div align="center">
<center>
</center>
</div>
<div align="center">
<p><font size="2" face="Arial, Helvetica, sans-serif"><a href="timeslipadd.php"><font color="123642" class="nf"><b>Add
your Timeslip to the Database</b></font></a> </font></p>
</div>
<tr>
<td width="100%"> <table width="98%" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#000000">
<tr bgcolor="0072BC">
<th>
<div align="center"><font size="2" face="Arial, Helvetica, sans-serif"><a href="TIMESLIP.php?sortby=DRIVER">Driver</a>
</font></div></th>
<!-- the other six headers omitted... -->
<th>
<div align="center"><font size="2" face="Arial, Helvetica, sans-serif"><a href="TIMESLIP.php?sortby=MAKE">Make</a>
</font></div></th>
<th>
<div align="center"><font size="2" face="Arial, Helvetica, sans-serif"><a href="TIMESLIP.php?sortby=Model">Model</a>
</font></div></th>
<th>
<div align="center"><font size="2" face="Arial, Helvetica, sans-serif"><a href="TIMESLIP.php?sortby=Year">Year</a>
</font></div></th>
<th>
<div align="center"><font size="2" face="Arial, Helvetica, sans-serif"><a href="TIMESLIP.php?sortby=Induction">Power
Adder</a> </font></div></th>
<th>
<div align="center"><font size="2" face="Arial, Helvetica, sans-serif"><a href="TIMESLIP.php?sortby=ET">1/4
Mile ET</a> </font></div></th>
<th>
<div align="center"><font size="2" face="Arial, Helvetica, sans-serif"><a href="TIMESLIP.php?sortby=Trap">Trap
Speed</a> </font></div></th>
<th>
<div align="center"><font size="2" face="Arial, Helvetica, sans-serif"><a href="TIMESLIP.php?sortby=LOCATION">Track
Name</a> </font></div></th>
</tr>
<?
if(empty($sortby)) $sortby = "ET";
$dbh=mysql_connect ("localhost", "xxx_xx", "xxxxxx") or die ('I cannot connect to the database.');
mysql_select_db ("xxx_forums");
$result = @mysql_query("SELECT * FROM TIMESLIPS ORDER BY $sortby");
if (!$result)
{
echo("<p>Error performing query: " . mysql_error() . "</p>");
exit();
}
while ($row = mysql_fetch_array($result))
{
$driver = $row["DRIVER"];
$make = $row["MAKE"];
$model = $row["MODEL"];
$year = $row["YEAR"];
$induction = $row["INDUCTION"];
$et = $row["ET"];
$trap = $row["TRAP"];
$trackname = $row["LOCATION"];
?>
<tr bgcolor="f5f5f5">
<td>
<div align="center"> <font color="000000" size="2" face="Arial, Helvetica, sans-serif">
<?=$driver?>
</font></div></td>
<!-- six other columns here...-->
<td>
<div align="center"> <font color="000000" size="2" face="Arial, Helvetica, sans-serif">
<?=$make?>
</font></div></td>
<td>
<div align="center"> <font color="000000" size="2" face="Arial, Helvetica, sans-serif">
<?=$model?>
</font></div></td>
<td>
<div align="center"> <font color="000000" size="2" face="Arial, Helvetica, sans-serif">
<?=$year?>
</font></div></td>
<td>
<div align="center"> <font color="000000" size="2" face="Arial, Helvetica, sans-serif">
<?=$induction?>
</font></div></td>
<td>
<div align="center"> <font color="000000" size="2" face="Arial, Helvetica, sans-serif">
<?=$et?>
</font></div></td>
<td>
<div align="center"> <font color="000000" size="2" face="Arial, Helvetica, sans-serif">
<?=$trap?>
</font></div></td>
<td>
<div align="center"> <font color="000000" size="2" face="Arial, Helvetica, sans-serif">
<?=$trackname?>
</font></div></td>
</tr>
<?
}
?>
</table><font size="2" face="Arial, Helvetica, sans-serif"></body></font>
<font size="2" face="Arial, Helvetica, sans-serif">
<?php
echo "<br>";
include("footer.php");
?>
</font>