Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-19-2010, 12:11 AM   PM User | #1
seco
Regular Coder

 
seco's Avatar
 
Join Date: Nov 2008
Location: Oregon
Posts: 682
Thanks: 5
Thanked 79 Times in 77 Posts
seco has a little shameless behaviour in the past
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..
seco is offline   Reply With Quote
Old 12-19-2010, 01:02 AM   PM User | #2
durangod
Senior Coder

 
Join Date: Nov 2010
Posts: 1,177
Thanks: 214
Thanked 31 Times in 30 Posts
durangod is on a distinguished road
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?
durangod is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:35 PM.


Advertisement
Log in to turn off these ads.