I have added a won and lost field to simplify code needed to work out if its a win or loss - can simply put a 1 into db for a win record
Got to this stage with code so far , but plenty to change i feel ..
<TABLE ALIGN="center" BORDER="4" CELLSPACING="0" CELLPADDING="0" WIDTH="80%">
<tr><th>PLAYER</th><th>PLAYED</th><th>WON</th><th>LOST</th><th>LEGS FOR</th><th>LEGS AGAINST</th><th>DIFF</th><th>POINTS</th></tr>
/* declare some relevant variables */
$DBhost = "localhost";
$DBuser = "******";
$DBpass = "******";
$DBName = "******";
$table = "fixturesdiv1";
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
mysql_select_db("$DBName") or die("Unable to select database $DBName");
$sql = 'SELECT home , SUM( played ) , SUM( won ) , SUM( lost ) , SUM( hscore ) , SUM( ascore ) , SUM( hpoints ) , SUM( apoints ) '
. ' FROM fixturesdiv1 '
. ' GROUP BY home '
. ' ORDER BY apoints DESC LIMIT 0, 30 ; ';
if (!$result = mysql_query($sql))
die('<b>Error:</b> could not query database');
while ($row = mysql_fetch_assoc($result))
foreach ($row as $r)
echo '<td align="center">' . $r . '</td>';
HELP is still desperately needed