ok I have got the code on my webpage but the echo is not working or its not displaying the next page or any numbers... this is what i have for the echo numbers..
Thats the complete code that I am useing, and I cant figure out why its not paginating it...PHP Code:<?
include("dbconnect.php");
$pagenumber = 10;
if(!isset($_GET['cursors'])) { $page = 1;}else { $page = (int)$_GET['cursors'];}
$from = (($cursors * $pagenumber) - $pagenumber);
$getnews = mysql_query("select * from db ORDER BY id DESC LIMIT $from,
$pagenumber");
while($r=mysql_fetch_array($getnews)){
extract($r);
echo("
<table width='100%' cellspacing='1' cellpadding='5' bgcolor='#333333' align='center'><tr><td class='title2'><center><font size='4'><a>$news</a></font><BR><BR><img style=\"cursor: url('$url')\" src=\"$img\" width=\"100\"><BR>Body<BR><textarea><style><!--BODY{cursor:url(\"$url\");}--></style><a href=\"http://www.xudas.com\"><img src=\"http://www.xudas.com/images/xudasaffy.gif\" border=\"0\"></a></textarea><br><a style=\"cursor: url('$url')\" href=\"#\">Hover over a Link</a><BR><textarea><style>A:hover{cursor: url(\"$url\");}</style>
<a href=\"http://www.xudas.com\"><img src=\"http://www.xudas.com/images/xudasaffy.gif\"
border=\"0\"></a></textarea><br><br></td></tr></table><BR>
");
}
echo "Pages: ";
$total_results = mysql_fetch_array(mysql_query("SELECT COUNT(*) as num FROM db where
parentid='0'"));
$total_pages = ceil($total_results['num'] / $pagenumber);
if ($cursors > 1) { $prev = ($cursors - 1);
echo "$i";
}for($i = 1;
$i <= $total_pages; $i++) { if ($cursors == $i) {
echo "<a href=\"index.php?cursors=$i\">$i</a> ";
} else {
echo "<a href=\"index.php?cursors=$i\">$i</a> ";
}}
if ($cursors < $total_pages) {
$next = ($cursors + 1);
echo "<a href=\"index.php?cursors=$next\"> Older </a>";}
?>
It paginates it but doesn't display the numbers... plz help..
is there anything wrong with that code...



(:
Reply With Quote

Bookmarks