Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Apr 2006
    Posts
    231
    Thanks
    9
    Thanked 1 Time in 1 Post

    Flat File Pagination

    I'm using a flat file to keep the data for my downloadable files. I'm using the explode function to take info and make it an array. It works extremely well for my purposes. Now I have gotten to the point where there are too many downloads. Is there any easy way of making a pagination, displaying 10 items per page from the flat file (.txt)?

    Google comes up with MySQL pagination, not flat file.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,509
    Thanks
    8
    Thanked 1,090 Times in 1,081 Posts
    Hard to tell without seeing the PHP script.

    When you print out your array, line by line, you'll have a counter
    variable that stops the listing and displays a link to continue on.

    So, you'll have a subroutine (function) in your PHP script that handles
    just the printout based on the line count.

  • #3
    Regular Coder
    Join Date
    Apr 2006
    Posts
    231
    Thanks
    9
    Thanked 1 Time in 1 Post
    I've decided to change to MySQL now. Flat files are a pain in the arse.

  • #4
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,509
    Thanks
    8
    Thanked 1,090 Times in 1,081 Posts
    With many entries, that's a good decision.


  •  

    Posting Permissions

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