Jump to content

Archived

This topic is now archived and is closed to further replies.

IMakeLousyCode

Two ways to do it, which one is better?

Recommended Posts

Hi!

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
<id=1>
news
</id>

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

Thanks for help

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

×

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.