Hi,
I have a list of db entries which display in an html table, line after line (listed by db id)
However, the list is ever-growing, causing the page to take a while to load. Ideally I would like to display 20 db entries per page, and then have "next 20" & "previous 20" (if applicable) links which will display the next 20. Also, I need to display something like "viewing 1-20 of 100 records" which updates on next 20 (i.e: "viewing 21-30 of 100 records" and so on)
Any ideas how I go about this? The current code I have for the recursive tables is:
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM data ORDER BY id DESC";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while ($i < $num) {
$id=mysql_result($result,$i,"id");
$policytype=mysql_result($result,$i,"type");
$policynum=mysql_result($result,$i,"num");
$issued=mysql_result($result,$i,"date");
echo "<td>$id</td>";
echo "<td>$num</td>";
echo "<td>$type</td>";
echo "<td>$date</td>";
echo "<td>$dbview</td>";
echo "<td>$dbedit</td>";
echo "<td>$dbnotes</td>";
echo "<td>$dbdelete</td>";
echo "</tr>";
++$i;
}
TIA
Jonathen