I want to conclude similar articles. There is a table of articles, well, let's say with the name, articles with the fields id, text, title, etc. Doing a query like every time you view the article is too resource-intensive. Therefore, you need to somehow write the id-schniki of similar articles to the database. And from there pull out their JOIN request. And add these id at each creation or editing of the article.
As I understand it in mysql there is no split function for a string. Therefore, the conclusion suggests itself that adding a varchar-column of type likes to this table will not solve it. There is an idea to make a separate table with the news_id
and news_likes_id
. And already there to write down id'shniki of all similar articles. Those. for each article, for example, there will be several lines:
news_id news_likes_id 1 5 1 6 1 4 4 5 ...
I hope everything is clear outlined. Maybe you have other ideas?