Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Oct 2011
    Posts
    113
    Thanks
    9
    Thanked 1 Time in 1 Post

    Trying to display top purchases in list [simple help]

    I'm trying to display the Top Purchases, but it doesn't order it from highest amount to lowest

    PHP Code:
    <!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

  • #2
    Regular Coder
    Join Date
    Oct 2011
    Posts
    113
    Thanks
    9
    Thanked 1 Time in 1 Post
    Please anyone It;s not ordering


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •