...

View Full Version : Trying to display top purchases in list [simple help]



Vernk
02-20-2012, 01:33 AM
I'm trying to display the Top Purchases, but it doesn't order it from highest amount to lowest


<!DOCTYPE HTML>
<HEAD>
<link rel="stylesheet" href="style.css" type="text/css">
</HEAD>
<BODY BGCOLOR="#1D1D1D">
<?php require "config.inc.php"; ?>
<div style="margin-bottom:10px; background-image: url('donate.png'); background-position:center; background-repeat:no-repeat; width:162px; height:60px;"></div>
<div class="box2"><?php
$result3 = mysql_query("SELECT * FROM data");
$total = mysql_num_rows($result3);
echo "<font color='white'><span class='text'>";
echo "<center>";
echo "Total ranks Sold: ";
echo $total;
echo "</center>";
echo "</font></span>";
?></div>
<form action="index.php">
<input type="submit" class="button" value="<- Go Back">
</form><br />
<?php
$result23 = mysql_query("SELECT * FROM data ORDER BY price DESC LIMIT 10");
echo '<span class="text" style="font-size:14px;"><table border="0px" cellpadding="1" cellspacing="1">
<tr>

<th width="30"><strong><font color="#0D58A6" size="3px">User</font></strong></th>
<th width="30"><strong><font color="#0D58A6" size="3px">Payed</font></strong></th>
<th width="30"><strong><font color="#0D58A6" size="3px">Rank</font></strong></th></tr></tr>';
while ($row = mysql_fetch_array($result23)) {
$id = $row['id'];
$price = $row['price'];
$rank = $row['rank'];
$user = $row['username'];

print '<font color="white"><tr align="center">';

echo '

<td><strong>' . $row["username"] . '</strong></td>
<td><strong>$' . $row["price"] . '.00</strong></font></td>
<td><strong>' . $row["rank"] . '</strong></font></td>';

}
print "</table></span>";
?>
</BODY>
</HTML>





Here is what it display's
http://gyazo.com/597e92fc838f5e998c69a23212bd75f8.png

Vernk
02-20-2012, 04:33 AM
Please anyone :( It;s not ordering



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum