Jump to content

Get row number???


Vivid Lust

Recommended Posts

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>

 

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.