Hi all,
I'm working on a script that browses through a database, outputting ten results a page. At the bottom of my page I have a previous and next link.
Something weird is happening though. The first two pages work fine, but after that, instead of displaying the next ten results, it displays the nine results that were already there, with one result from the next page.
I'm pretty sure it's got something to do with my for loop, although I'm not sure. Here it is anyway...
$query = mysql_query("SELECT * FROM table ORDER BY $order LIMIT $page, 10");
}
for ($y=1; $y < mysql_num_rows($query); $y++) {
$row = mysql_fetch_assoc($query);
echo $row['username'];
echo "<br>";
}
Does anyone know what's wrong?
Thanks a lot,
Mike