Hello all im getting 3 mysql stored things like nick, auth id, and skillpoints.
Im getting around 100 results and i need to make pagination but i dont know how.
I want to show only 30 results per page.
This is my code:
<?php
require('config.php');
$iConnection = mysqli_connect($_HOST_,$_USER_,$_PASS_,$_MYDB_) or die("<link rel='stylesheet' type='text/css' href='style.css'><h4>Rank not found.</h4>")
?>
<html>
<head>
<title>sitename - ranking</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<table width="100%" border="0" cellpadding="1" cellspacing="1">
<tr>
<th>RANK</abbr></th>
<th>JOGADOR</abbr></th>
<th>STEAM ID</th>
<th>SKILLPOINTS</th>
</tr>
<?php
$sql = "SELECT * FROM iTUGA ORDER BY skillpoints DESC";
$iResult = mysqli_query($iConnection, $sql);
$i = 1;
while($Row = mysqli_fetch_array($iResult))
{
echo (!($i % 2)) ? "<tr>" : "<tr id='c'>";
switch($i)
{
case 1:
{
echo "<td style='text-align: center;' width='5%'><img src='images/1.png'></td>";
break;
}
case 2:
{
echo "<td style='text-align: center;' width='5%'><img src='images/2.png'></td>";
break;
}
case 3:
{
echo "<td style='text-align: center;' width='5%'><img src='images/3.png'></td>";
break;
}
default:
{
echo "<td style='text-align: center;' width='5%'>" . $i . "</td>";
break;
}
}
echo "<td style='text-align: center;' width='9%'>" . $Row['nick'] . "</td>";
echo "<td style='text-align: center;' width='9%'>" . $Row['authid'] . "</td>";
echo "<td style='text-align: center;' width='9%'>" . $Row['skillpoints'] . "</td>";
echo "</tr>";
$i++;
}
mysqli_close($iConnection);
?>
</table>
</body>
</html>
Thanks all.