Jump to content

Content-in-MySQL, newbie question


aeris130

Recommended Posts

I'm currently trying to learn about MySQL in order to get rid of about 350 php-files currently plaguing my host.

I've noticed that there's a lot of tutorials etc about storing contacts, passwords, etc, but I'm also interested in storing my entire content, including extensive articles.

So, first of all, how much space would be required for this? Also, are there any tutorials specifically regarding this, or can most tutorials about retrieving info from MySQL be applied?

In other words, is there anything special that I should keep in mind when storing extensive content, compared to names, phonenumbers etc?
Link to comment
https://forums.phpfreaks.com/topic/3531-content-in-mysql-newbie-question/
Share on other sites

Assuming you're just talking about text files (and not binary data), my recommendation would be to keep them in a separate table. TEXT/LONGTEXT fields are not fixed-width, so they may slow down queries on existing fixed-width tables. Otherwise, there's nothing special about storing 65K of text in one field vs storing 250 characters.
You shouldn't have any problems storing HTML in the database, although storing PHP code is slightly more involved (if you want it to be executed when it comes out).

One of the nice things about storing articles in MySQL is you can use COMPRESS() and UNCOMPRESS() to transparently save space. Some MySQL installations may not have support for it though.

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.