Jump to content


Two ways to do it, which one is better?

  • Please log in to reply
4 replies to this topic

#1 IMakeLousyCode

  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 04 October 2006 - 09:08 AM


I would like to know the experts opinion about a php script fetching news  ;D

Ok, so on this site it is possible to add, modify and delete news to be displayed on the website. But which way is the most efficient and quick way to store these news? In separate text files -> news_1.txt, news_2.txt ... which then is opened and read, or in one file only news separated maybe like

Does it really differ or matter concerning the dowloading time of the page?

Thanks for help

#2 JasonLewis

  • Members
  • PipPipPip
  • Advanced Member
  • 3,351 posts
  • LocationVictoria, Australia

Posted 04 October 2006 - 09:18 AM

it depends on you really. i would prefer mysql but if i didnt have that i would go for your 2nd option. you may end up with to much txt documents etc. that would be neater. but overall, sql is much better and secure.
Good luck with your coding.
Jason / ProjectFear / Jaysonic

#3 roopurt18

  • Staff Alumni
  • Advanced Member
  • 3,749 posts
  • LocationCalifornia, southern

Posted 04 October 2006 - 09:24 AM

The number of text files you end up with is really of no concern as long as there is a file management system.  The first option is the better option in my opinion.

What will happen when there are lots of articles for the site and the single text file grows to be very large?  You will have a lot of text parsing to go through to find the specific article you want which will not a fast website make.

What I really have to wonder is why aren't you using MySQL?
PHP Forms : Part I | Part II

JavaScript: Singleton


#4 ponsho

  • Members
  • PipPip
  • Member
  • 24 posts

Posted 04 October 2006 - 09:29 AM

I totally agree with roopurt18, i would use the first option if i couldnt use mysql, maybe with an index file or something like that

#5 IMakeLousyCode

  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 04 October 2006 - 10:09 AM

Okies, I will do it using MySQL! Thanks

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users