Jump to content

PHP Pagination

- - - - -

  • Please log in to reply
2 replies to this topic

#1
sachinsharma1507

sachinsharma1507

    Newbie

  • Members
  • Pip
  • 8 posts
How to create a professional database based PHP pagination like this -

see in snapshot

#2
bbqroast

bbqroast

    Codecall Addict

  • Members
  • PipPipPipPipPipPipPip
  • 554 posts
  • Location:/etc/passwd
I wrote a rough and inefficient tutorial on this, the theory and method were fine it was just that I was selecting all the items at once for somethings.
Basically you use a GET request (eg viewpage.php?page=2) multiply the result by the amount of results per page and then run a MySQL query with the order and limit options...

To get the buttons you just count how many rows ae in the database divide by the results per page and use a while loop to create the links. Did you try Googling?
Please, write clearly with proper structure. Double spacing makes the text feel un-jointed, Capitalizing Every Word Means People Stop Before Every Word Sub-Consciously Which Is A Pain In The Backside, and use code tags! (The right most styling box).

#3
delightful_girl

delightful_girl

    Newbie

  • Members
  • Pip
  • 4 posts
Hi sachinsharma1507,

Follow this 7steps
PHP Pagination

You will get the results what you want:cool:




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users