sasa Posted September 18, 2008 Share Posted September 18, 2008 try <?php require("includes/db.php"); $sql = "select * from users order by `s_phish` desc"; $result = mysql_query($sql, $link) or die(mysql_error()); ?> <center> <table cellpadding="0" width="50%" cellspacing="0"> <tr> <td> Rank </td> <td> Name </td> <td> Phishes </td> </tr> <?php $rank = 0; $score = 'imposible'; while ($row = mysql_fetch_array($result) AND $rank < 20) { $rank++; // adds 1 if($row['s_phish'] == $score){ $score = row['s_phish']; $rank1 = $rank; } echo "<tr><td>"; echo $rank1; echo "</td><td>"; echo " <a href='profile.php?id="; echo $row['id']; echo "'>"; echo $row['name']; echo "</a> "; echo "</td><td>"; echo $row['s_phish']; // put HTML break to end line echo "</td></tr>"; // echo "<br />"; } ?> </table> </center> Link to comment https://forums.phpfreaks.com/topic/124533-get-row-number/page/2/#findComment-644817 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.