K
K
krock000002017-03-12 20:05:04
PHP
krock00000, 2017-03-12 20:05:04

How to properly store the content of the series?

Hello.
I am creating a video resource, and the question arose of how best to implement this task.
I need to store episodes, seasons, ratings and comments of a series.
To do this, when creating each material on the site, I create several tables for it in the database:
1. Storing episodes (id, link_to_episode, season_number)
2. Storing ratings (id, user_nick, rating)
3. Comments (id, comment_text, user_nick)
At the end of the name of each of the tables, I add an identifier by which I determine that the table is for the desired material, and already on the material page I make a request to these three tables and display the content for the material.
Is this implementation acceptable?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2017-03-12
@krock00000

For each new series new tables? – No, this is unacceptable.
Do something like this:

  • Series table: id, title, year, description, director, IMDB rating, etc.
  • "Series": series_id, series_id (in S02E05 format), link
  • "Ratings": user_id, series_id (+series_id?), rating
  • "Users": id, nickname, password hash, last visit date
  • "Comments": id, series_id, user_id, comment text

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question