PHP interesse |
|
Hey mensen..
Ik heb een top 50 users lijst gemaakt.. alleen nu wil doen dat als er users zijn die dood zijn.. dus ( `life` < 0 ).. dat die dan uit de lijst worden gehaald.. of de `experience` op 0 zet.
zo ziet het script eruit:
<?
$sql1 = mysql_query("SELECT * FROM users ORDER BY experience DESC LIMIT 50");
$lasts = "SELECT * FROM `users` ORDER BY id DESC LIMIT 50";
$lasts = mysql_query($lasts);
$i=1;
?>
<center><table border=1 bordercolor=#000000 cellpadding=0 cellspacing=0 width=80%>
<th class="title" colspan=4>Top 50 Users</th>
<tr><td>Id</td><td>Username</td><td>Rank</td><td>Family</td>
</tr>
</tr>
<?
while($nuser = mysql_fetch_array($sql1)){
?>
<tr>
<td><?=$i; ?></td>
<td><a href=index.php?item=view&user=<?=$nuser['id']; ?>><?=$nuser['username']; ?></a></td>
<td><?=$nuser['rank']; ?></td>
<td><?=$nuser['crew']; ?></td>
</tr>
<?
$i++;
}
?>
</table></center>
<? $sql1 = mysql_query("SELECT * FROM users ORDER BY experience DESC LIMIT 50"); $lasts = "SELECT * FROM `users` ORDER BY id DESC LIMIT 50"; $i=1; ?> <center><table border=1 bordercolor=#000000 cellpadding=0 cellspacing=0 width=80%> <th class="title" colspan=4>Top 50 Users</th> <tr><td>Id</td><td>Username</td><td>Rank</td><td>Family</td> </tr> </tr> <? ?> <tr> <td><?=$i; ?></td> <td><a href=index.php?item=view&user=<?=$nuser['id']; ?>><?=$nuser['username']; ?></a></td> <td><?=$nuser['rank']; ?></td> <td><?=$nuser['crew']; ?></td> </tr> <? $i++; } ?> </table></center>
|