Jump to content

Rank Results - MySQL


papaface

Recommended Posts

Hello,
Please help me :)
How would I go about displaying a 1,2,3,4 etc up to the total amount of results for the query?
Here is my code
[code]<?php

require ('includes/connect.php');

$grab = mysql_query("select * from submissions order by inbound desc ",$con) or die (mysql_error());

while ($row = mysql_fetch_array($grab))
{
echo '<a href="out.php?out='.$row['subid'].'">'. $row['sitename']. "</a>" . "<br>";
}
?>[/code]
I would like to rank the results therefore I need the first time it goes through the while loop to print a '1' next to the link.

Any ideas?

regards
Link to comment
https://forums.phpfreaks.com/topic/34060-rank-results-mysql/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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