
Store everthing in one big text field as Alex suggested. If 2, is there an elegant way of making that text searchable? There is quite a lot I have written here on such a simple question, so I will break it down:ġ: Is there a "best" way of storing large amounts of formatted text directly in a database orĢ: is it better to hold paths to that text in the form of HTML/XML/Whatever documents. If I were to store text in separate files, how might I approach making these articles searchable? I know MySQL, for example, has SQL syntax for searching for specific terms/phrases inside strings held in a text field. This approach would of course require extra coding but it does present a problem with making articles searchable. It also allows the author to dictate when to create line/page breaks. I quite like the idea of storing articles as an XML document as I can easily markup an article with custom tags and use PHP's XML and XSLT functions to transform the XML to HTML.
#Synkron store database in a text file full
However, storing a full article as one long string makes for unhappy reading, so formatting is going to be needed.ĭo I store the article text along with all of the HTML or BBcode tags - or is it better to simply create the page in either a HTML or XML document and store the path to this file in the DB? I know most DBMSs have the TEXT datatype or equivalent and can hold a massive amount of text. While I believe that my database design is pretty good so far, I am still not entirely sure on the best way of storing articles or other large texts. The main reason is for learning purposes but I wont lie, there is a small amount of vanity included!

I am currently in the process of designing myself a database driven website.
