Jump to content

php mysql pagination without showing numbers


Codenames

Recommended Posts

in trying to display Prevous/Next like the one on this site like this

 

<< prev next >>

and not display like this

<< prev 1 2 3 4 5 next >>

anyone who can help me with this

Thanks,

 

my code

 

<?php

$sql1 = "SELECT COUNT(*) FROM addetails ";

$rs1 = mysql_query($sql1,$con);

$row1 = mysql_fetch_row($rs1);

$total = $row1[0];

$tp = ceil($total/5);

for($i = 1; $i <= $tp; $i++)

 

{

?>

<?php echo " <a href='Search.php?page=".$i."'><strong>".$i."</strong></a>";

} ?>

Pick a pagination tut that has the non-numerical links and just remove the loop that outputs the linked numbers.

 

For example, on this really old pagination tut I made:

http://www.phpfreaks.com/tutorial/basic-pagination

 

just remove the code block with this comment header:

// loop to show links to range of pages around current page 
Though as a sidenote, and this is totally IMO.. I hate pagination links that don't have the full controls.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.