trassalg Posted July 17, 2007 Share Posted July 17, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/60452-mysql-saving-article-text-in-database/ Share on other sites More sharing options...
solinent Posted July 17, 2007 Share Posted July 17, 2007 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! Quote Link to comment https://forums.phpfreaks.com/topic/60452-mysql-saving-article-text-in-database/#findComment-300710 Share on other sites More sharing options...
trassalg Posted July 18, 2007 Author Share Posted July 18, 2007 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)? Quote Link to comment https://forums.phpfreaks.com/topic/60452-mysql-saving-article-text-in-database/#findComment-300851 Share on other sites More sharing options...
anatak Posted July 18, 2007 Share Posted July 18, 2007 for manipulating files you have to look into fopen() fwrite() fread() Quote Link to comment https://forums.phpfreaks.com/topic/60452-mysql-saving-article-text-in-database/#findComment-300937 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.