so if i have 30 rows in that database i want it to print out 3 links the first lets you se the first 10 rows then the second lets you see the rows from 10 to 20 and so on, hope you understand what im mean, im not very good at explain things.
whell here is the script i got
Code: Select all
<?php
include("/inc/connect.php");
if (mysqli_connect_errno()) {
die (mysqli_connect_error());
}
echo "<center><table><tr><td class='tdstyle'>Score</td><td class='tdstyle1'> Username </td></tr></table></center>";
$sql = 'SELECT * FROM DATABASE ORDER BY score DESC LIMIT 10';
$result = $db->query($sql);
if (!$result) {
die ('Query failed, query was: '.$sql."<br />\nError message: ".$db->error);
}
if (!$result->num_rows) {
echo '<p class="info">no one is registred</p>';
} else {
while ($row = $result->fetch_assoc()) {
$userID="SELECT * from eatyou_login where id ='.$row[id].'";
$getscore2=mysql_query($userID) or die("Could not get player");
$getscore3=mysql_fetch_array($getscore2);
echo "<center><table><tr><td class='tdstyle'>$getscore3[score]</td><td class='tdstyle1'>$getscore3[username]</td></tr></table></center>";
}
}
?>