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>";

} ?>

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.