E
E
Evgeny Romashkan2018-02-27 21:47:08
MySQL
Evgeny Romashkan, 2018-02-27 21:47:08

What is the best way to implement the database structure for a blog (comments)?

I am creating my own blog. There is a table of articles with fields: id, title, date, content
I want to implement the ability to comment on each article.
Would it be correct to create one large table, store all comments in it, and make one of the fields article_id, which will point to the article to which the comment refers? And when displaying comments, select everything by article_id?
This option seems to me the most correct. But a little bulky. But there is no actual experience. So maybe I could be wrong.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2018-02-27
@EvgeniiR

Normal option, the main thing is not to forget the index by article_id to stir up.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question