SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Pagination Question

  1. #1
    SitePoint Zealot
    Join Date
    Jul 2006
    Location
    Closer than you think
    Posts
    149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Pagination Question

    In order to do Pagination I could only think of two methods. First off I am using PHP as my server side scripting.

    So Currently I run a MySQL Statement. To get a Total Count of records that fit the query.

    Then I run the same exact Query but I add a Limit Statement to me. To me this seems excessive and not efficent so i though would it be better to just run the query once and then allow PHP to create limits.

    Any thoughts on this? How are you doing Pagination?
    Live Well.

  2. #2
    An average geek earl-grey's Avatar
    Join Date
    Mar 2005
    Location
    Ukraine
    Posts
    1,403
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by WeakestLink View Post
    so i though would it be better to just run the query once and then allow PHP to create limits.
    No. Check out SQL_CALC_FOUND_ROWS

  3. #3
    SitePoint Zealot
    Join Date
    Jul 2006
    Location
    Closer than you think
    Posts
    149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks man that was so key!
    Live Well.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •