<?php
$host = "localhost";
$usr = "root";
$pwd = "";
$db= "DB";
conOpen($host,$usr,$pwd,$db);
function conOpen($host,$usr,$pwd,$db){
$con=mysql_connect($host,$usr,$pwd) or die ("Connection Failed ");
mysql_select_db($db,$con);}
$rows_per_page=5;
// database connection stuff here
$result=mysql_query("Select * from newsimage");
$pages=ceil(mysql_num_rows($result)/$rows_per_page);
if (!isset($screen))
$screen = 0; else echo $_GET[screen];
/*
$start = $screen * $rows_per_page;
$sql = "SELECT nId FROM newsimage ";
$sql .= "LIMIT $start, $rows_per_page";
$result = mysql_query($sql);
$rows = mysql_num_rows($result);
for ($i = 0; $i < $rows; $i++) {
$description = mysql_fetch_array($result);
echo "\$description = $description[nId]<br>\n";
}
echo "<p><hr></p>\n";
// let's create the dynamic links now
if ($screen > 0) {
$url = "z.php?screen=" . $screen - 1;
echo "<a href=\"$url\">Previous</a>\n";
}
// page numbering links now
for ($i = 0; $i < $pages; $i++) {
$url = "z.php?screen=" . $i;
echo " | <a href=\"$url\" onClick=\"window.location.reload(true)\">$i</a> | ";
}
if ($screen < $pages) {
$url = "z.php?screen=" . $screen + 1;
echo "<a href=\"$url\">Next</a>\n";
}*/
?>
I am using the above code for record navigation
But On Click on hyperlinks 1,2
I didn't get the next records
Please help me