Jump to content

MySQL - saving article text in database


trassalg

Recommended Posts

I'm putting together a site for a friend to use as a local database management tool.  Basically, he'll store the date of the entry, the number of the entry, category of the entry and a magazine article's text.

 

Is it risky (and/or stupid) to save the magazine articles' texts in the database or better to have them stores in some sort of text file, referenced by the php site?

 

Any ideas/opinions would be appreciated.

Link to comment
https://forums.phpfreaks.com/topic/60452-mysql-saving-article-text-in-database/
Share on other sites

I store it in the database.

 

It probably depends on how long the main body of the news is going to be.  If it's normally quite big, then use files.  If it's average (I dunno, maybe under 8k characters?) then keep it in the database.

 

Obviously, it's easier to use and maintain it if it is in a database.  I see no disadvantage to it, either, but I'm not extremely experienced, so don't go by my opinion alone!

I appreciate the quick reply.  I'm obviously new to the whole database concept and based on what I've been reading in PHP & MySQL For Dummies, was kind of concerned as it mentions that you should try and have a good idea of the size (or rather, max size) of the content that's going into the datatbase.  As the articles' text will obviously be a dynamic thing, each article being unique, I wasn't quite sure.

 

So then, as a followup question, is there an easy way to, by using php to create a txt file, enter text in the form fields, and have all but one field be entered into the database (the other field being fed to a new txt file that's numbered sequentially)?

Archived

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

×
×
  • 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.