Jump to content

Displaying Information from Flat File DB


kennywhite

Recommended Posts

I want to make the news feed on my website easier to maintain. I just created a form that I will use to add the information. The form saves the files that it creates as "entry-date-time.txt" and places it in a folder for the year and a sub folder for the month. Such as "2011\09".

 

I have displayed data from a single flat file before, but I am unsure how to go about displaying the data from multiple files. Can anyone show me an example?

 

I want to be able to paginate the data, displaying a number of updates per page from newest to oldest.

 

I don't have MySQL access on the server or I'd just use that, instead.

Link to comment
Share on other sites

Just be aware that to do the pagination requires that you read ALL the data from all the files on every page load - that would be the only way to properly paginate.

 

You *could* implement some "workarounds" to alleviate that based on your specific needs. For example, if you will be updating the news feeds on manual basis, you could could create a script that would read all the data and programmatically create the "pages" as individual files. Then there would be no performance issues when the users are accessing the pages. It's really going to be determined on how much data you need to work with and the various functions you want to support.

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.