SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: Pagination

  1. #1
    SitePoint Member lateralis's Avatar
    Join Date
    May 2003
    Location
    Scotland
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Pagination

    Something like that anyway!

    I have a simple database which stores information about various music artists.

    Users can insert new entries to a particular artist, eg:

    artists
    ->album1
    ->album2
    ->album3 ...etc

    What Im having trouble with is on the main page (the page where you click the artists name) should a particular artists have more than say 5 entries beside it, I want to display a link to jump to a particular page.

    I guess what Im trying to do is similar to a forum, when a particular post has lots and lots of replies, it displays [1 2 3] and you can click to jump to page 3 of replies, or whichever page you wish.

    How can i create a function that counts the number of add ons to my artist database and if it is above a certain value (5) it displays [1 2], and then so on as more entries are added??

    Get me? ive tried to be as clear as possible!!!

    Pablo de la Pena

  2. #2
    SitePoint Wizard Rick's Avatar
    Join Date
    Oct 2002
    Location
    Lancashire, UK
    Posts
    3,847
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think I've missed what your trying to do a little here, sorry.

    Are you trying to do like a page numbers thing?

    If so I have attached (when it gets approved) a set of scripts created by a member here (can't remeber who) that you can include on a page and use to create page numbers, i.e. if there are more than say 5 results it will output 1, 2, 3 etc as needed.

    Not sure if this is what your after, but its a useful little set of scripts never-the-less which I have used countless times.

    ZOO
    Attached Files Attached Files
    Rick

  3. #3
    SitePoint Wizard Crowe's Avatar
    Join Date
    Nov 2001
    Location
    Huntsville
    Posts
    1,117
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Check out the DB_Pager class from Pear. Looks solid.
    Chrispian H. Burks
    Nothing To Say

  4. #4
    SitePoint Member lateralis's Avatar
    Join Date
    May 2003
    Location
    Scotland
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks! but how do i view your attctchments?

    byt he way zoo, thats EXCTLY what I'm after!

  5. #5
    SitePoint Enthusiast webmasts's Avatar
    Join Date
    Apr 2003
    Location
    usa
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  6. #6
    SitePoint Wizard Rick's Avatar
    Join Date
    Oct 2002
    Location
    Lancashire, UK
    Posts
    3,847
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lateralis
    thanks! but how do i view your attctchments?

    byt he way zoo, thats EXCTLY what I'm after!
    Now its been approved you can click the link and download it.

    Glad its what your looking for
    Rick

  7. #7
    SitePoint Member lateralis's Avatar
    Join Date
    May 2003
    Location
    Scotland
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by webmasts
    thats a decent tutorial too!


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
  •