Topic: pagination
Okay I want to have a new page for every x number of results that are queried in a table. The page can be seen here.
Here is how I coded the thing
<?php
// Perform the query
$query = 'SELECT id, username, iwins, ilosses, ipoints FROM xusers' . ' ORDER by ipoints DESC' ;
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
$id = '<a href="profile.php?id='.$line['id'].'">'.pun_htmlspecialchars($line['username']).'</a>' ;
if ($db->num_rows($result))
{
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "\t<tr>\n";
?>
<td class="tcl" scope="col"><?php echo '<a href="iprofile.php?id='.$line['id'].'">'.pun_htmlspecialchars($line['username']).'</a>' ?></td>
<td class="tc2" scope="col"><?php echo $line['iwins']; ?></td>
<td class="tc3" scope="col"><?php echo $line['ilosses']; ?></td>
<td class="tc4" scope="col"><?php echo $line['ipoints']; ?></td>
<?php
}
echo "\t</tr>\n";
}
echo "</table>\n";
?>
*note if you are looking through the features on the site you will notice that the ladder is incomplete, specifically the iprofile pages which I am currently working on aswell and fixing up db for it.
edited: hid some of query