mysql_connect('localhost','root','');
mysql_select_db('Test');
$perpage=5;
$totalpage=mysql_num_rows(mysql_query('SELECT * FROM pagination'));
$pagination=ceil($totalpage/$perpage);
-------------------------------------------------------------------------------------------------------------------
if(isset($_GET['page']))
{
$page=$_GET['page'];
}
else
(
$page=1
);
$startfrom=($page-1)*$perpage;
$fnal_query ='SELECT * FROM pagination LIMIT '.$startfrom.','.$perpage ;
$result=mysql_query($fnal_query);
---------------------------------------------------------------------------------------------------------------------
for($i=1;$i<=$pagination;$i++)
{?>
<a href="<?php echo '?page='.$i;?>">
<?php echo $i; ?>
</a>
<?php }?>
mysql_select_db('Test');
$perpage=5;
$totalpage=mysql_num_rows(mysql_query('SELECT * FROM pagination'));
$pagination=ceil($totalpage/$perpage);
-------------------------------------------------------------------------------------------------------------------
if(isset($_GET['page']))
{
$page=$_GET['page'];
}
else
(
$page=1
);
$startfrom=($page-1)*$perpage;
$fnal_query ='SELECT * FROM pagination LIMIT '.$startfrom.','.$perpage ;
$result=mysql_query($fnal_query);
---------------------------------------------------------------------------------------------------------------------
for($i=1;$i<=$pagination;$i++)
{?>
<a href="<?php echo '?page='.$i;?>">
<?php echo $i; ?>
</a>
<?php }?>