// get page list
$number = mysql_query("SELECT COUNT(*) FROM sheetmusic") or die(mysql_error());
$count = (mysql_result($number, 0, 0));
$page_count = ceil( $count / 100 );
$page = ceil( $x / 100 ) + 1;
if ($x < 100) {
echo("<< Previous 100");
} else {
echo("<< Previous 100");
}
echo(" | Page " . $page . " of " . $page_count . " | ");
if (($x + 100) >= $count) {
echo("Next 100 >>");
} else {
echo("Next 100 >>");
}
?>
if(isset($_GET['x'])){
$x = $_GET['x'];
}
else{
$x = 0;
}
// show records
$result = mysql_query("SELECT * FROM sheetmusic where instruments like 'saxophone' ORDER BY title asc LIMIT $x, 100") or die (mysql_error());
// echo results
$numofrows = mysql_num_rows($result);
print "
\n";
print "
Title
Price
Instruments
Formats
Genre
Publisher
Information
\n";
$count=1;
for($i = 0; $i < $numofrows; $i++) {
$row = mysql_fetch_array($result); //get a row from our result set
if($i % 2) { //this means if there is a remainder
print "
\n";
} else { //if there isn't a remainder we will do the else
print "