Answer the question
In order to leave comments, you need to log in
What is the best way to store articles for a website in a database?
Let's assume that there is a thematic portal where users can publish articles. Articles will be written in textarea, where it will be possible to insert various additions (citations, lists, images, etc.). Here is an example of inserting an add-on:
To insert an image, the user must add this code:
And on the server it will be replaced with something like this:
<img src="НОМЕР ИЗОБРАЖЕНИЯ" title="ОПИСАНИЕ" />
<div class="img-block">
<img src="НОМЕР ИЗОБРАЖЕНИЯ" />
<p>ОПИСАНИЕ</p>
</div>
Answer the question
In order to leave comments, you need to log in
Yes, you are basically correct.
You will parse the source text, look for key structures in it? It's easier to do this once when saving the article and output the finished html.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question