Code:
<?php
$host='localhost';
$user='root';
$password='root';
$database='database';
$startindex=@$_REQUEST['seek'];
$db=mysql_connect($host, $user, $password)
or die ("Impossibile connettersi al server $host");
mysql_select_db($database, $db)
or die ("Impossibile connettersi al database $database");
$query="SELECT * FROM ordini_master";
$dbResult=mysql_query($query, $db);
$AffectedRows=mysql_affected_rows($db);
mysql_data_seek($dbResult, $startindex);
$row=mysql_fetch_row($dbResult);
foreach($row as $k=>$v)
{
$myfield=mysql_fetch_field($dbResult, $k);
print($myfield->name . " : $v <br/>");
}
mysql_free_result($dbResult);
mysql_close($db);
print("<br/>Seleziona il record<br/>");
for($index=0; $index<$AffectedRows; $index++)
{
print("<a href=\"{$_SERVER['PHP_SELF']}?seek=$index\" >" .
($index+1) . "</a> ");
}
?>
This code enables switching between a query's records, creating a page for every record in the database and displaying one record at a time. How can I change that code to page through records every ten? I want to display 10 records at a time and then make a page for the following.