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 seco's Avatar
    Join Date
    Nov 2008
    Location
    Oregon
    Posts
    687
    Thanks
    6
    Thanked 79 Times in 77 Posts

    RESOLVED query position numbers?

    So my question is, Im querying out a mysql while loop, the most basic

    PHP Code:
    select from rank order by score DESC 
    In the loop is it possible to have each row show its position by number next to it, like an ordered list but not in a ordered list?

    example

    234213 position 1
    123232 position 2
    99322 position 3

    etc

    thanks

    EDIT ok it was easy

    PHP Code:
    <?php
    //Dynamically creating # per row result withing a while loop
      
    $counter ++;
      echo 
    $counter;
    ?>
    Last edited by seco; 12-19-2010 at 07:59 AM.

  • #2
    Senior Coder
    Join Date
    Nov 2010
    Posts
    1,383
    Thanks
    264
    Thanked 32 Times in 31 Posts
    if you echo the value of (i) each time i wonder if that would work or is that not deep enough, would you need to show where element pointer is?


  •  

    Posting Permissions

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