waturl
08-18-2007, 07:26 AM
Hello,
I can can print "previous - next"
but i need it to be like "previous 1 2 3 4 5 6 7 next"
here is the code how i print the previous and next.
$page = $_GET['page'];
$pagesize = 15;
if ($page == ''){$page=1;}
$start = ($page - 1) * $pagesize;
include "databaseconnexion.php";
mysql_query("select * from databese");
if(mysql_affected_rows() <= 0){
print "there's no data";
}else{
$fullresult = mysql_affected_rows();
$p=mysql_query("select * from database order by id desc LIMIT $start,$pagesize ");
while($row = mysql_fetch_array($p)){
print $row['id'];
//showing the data
}
<a href='link.php?page=<?=$page-1?>'><font color='575757'>previous < |</font></a>
}else{
print "<font color='CCCCCC'>next < |</font>";
}
if( $page*$pagesize < $fullresult){
<a href='home.php?page=<?=$page+1?>'><font color='575757'>| > Next</font></a>
}else{
print "<font color='CCCCCC'>| > Previous</font>";
}
It's just an exemple...hope you can help me..the easy way to number the result.
Thank you
I can can print "previous - next"
but i need it to be like "previous 1 2 3 4 5 6 7 next"
here is the code how i print the previous and next.
$page = $_GET['page'];
$pagesize = 15;
if ($page == ''){$page=1;}
$start = ($page - 1) * $pagesize;
include "databaseconnexion.php";
mysql_query("select * from databese");
if(mysql_affected_rows() <= 0){
print "there's no data";
}else{
$fullresult = mysql_affected_rows();
$p=mysql_query("select * from database order by id desc LIMIT $start,$pagesize ");
while($row = mysql_fetch_array($p)){
print $row['id'];
//showing the data
}
<a href='link.php?page=<?=$page-1?>'><font color='575757'>previous < |</font></a>
}else{
print "<font color='CCCCCC'>next < |</font>";
}
if( $page*$pagesize < $fullresult){
<a href='home.php?page=<?=$page+1?>'><font color='575757'>| > Next</font></a>
}else{
print "<font color='CCCCCC'>| > Previous</font>";
}
It's just an exemple...hope you can help me..the easy way to number the result.
Thank you
