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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.