Jump to content

stats list


netman182

Recommended Posts

I am having a problem with a list i have tabel.

 

I am trying to have the players names come up in order of the most amount of points. it is not working the way i want it to and i am having problems doing it.

 

can anyone give some help?

 

eg.

here is what i want:

 

name:              pts:

player 4            45

player 3            31

player 2              20

player 1            3

player 5            1

 

here is what it is it shows : http://www.bccsl.org/stats/2010/scoring/thrsou.php

 

as you notice it is showing them in the wrong order.

 

here is my code:

 

<?php
$con = mysql_connect("localhost","*********","******");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("***********", $con);

$result = mysql_query("SELECT * FROM players WHERE division='thrsou' AND point >= '1' ORDER BY point DESC ");

echo "<table border='1'>
<tr>
<th><div align='center'>Name</div></th>
<th><div align='center'>Team</div></th>
<th><div align='center'>Games Played</div></th>
<th><div align='center'>Goals</div></th>
<th><div align='center'>Assists</div></th>
<th><div align='center'>Points</div></th>
</tr>";

while($row = mysql_fetch_array($result))
  {
  echo "<tr>";
  echo "<td><div align='center'>" . $row['first'] . " " . $row['last'] . "</div></td>";
  echo "<td><div align='center'>" . $row['teamname'] . "</div></td>";
  echo "<td><div align='center'>" . $row['gp'] . "</div></td>";
  echo "<td><div align='center'>" . $row['goal'] . "</div></td>";
  echo "<td><div align='center'>" . $row['assist'] . "</div></td>";
  echo "<td><div align='center'>" . $row['point'] . "</div></td>";
  echo "</tr>";
  }
echo "</table>";

mysql_close($con);
?> 

Link to comment
https://forums.phpfreaks.com/topic/204137-stats-list/
Share on other sites

Here's what I get at that URL:

Not Found

 

The requested URL /stats/2010/thrsou.php was not found on this server.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Link to comment
https://forums.phpfreaks.com/topic/204137-stats-list/#findComment-1069196
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.