Jump to content


Photo

Retrieving some tabular data from a flat file


  • Please log in to reply
4 replies to this topic

#1 stinhambo

stinhambo
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 05 July 2006 - 12:56 AM

Hi there,

I am working on a tourism based website. They run tours with varying times based on the month of the year.

So basically I need to create a flat file with various timetables (about 7) which will hold the month and about 4 times of the day - Here is an example of one of the timetables -

November    10.00am
                  12.00pm
                  14.00pm
                  16.00pm

I want to be able to retrieve the timetable from a flat file based on the server date so if the SERVER date is November then the timetable above will be pulled and entered into a table.

I've had a look at serialisation and fopen but I can't quite get my head around it..

Thanks for any help in advance!

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 05 July 2006 - 01:13 AM

Any reason why your not using a database?

#3 stinhambo

stinhambo
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 05 July 2006 - 01:51 AM

Any reason why your not using a database?


Seems a bit overkill to set up a MySQL database just to store something so simple or is it?

#4 cmgmyr

cmgmyr
  • Members
  • PipPipPip
  • Advanced Member
  • 1,278 posts
  • LocationUSA

Posted 05 July 2006 - 01:59 AM

It might be overkill right now, but what if later you wanted to add more data, atleast in MySQL you can easily upgrade your tables to hold more data without messing with too much. Also MySQL is a LOT easier then messing around with flat files...IMO.

-Chris

#5 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 05 July 2006 - 02:09 AM

Databases are made for querying data. In the long run, if you want to sort, then a db is probably a better option. MySql overkill? Maybe use sqlite?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users