문제

I have a table for a movie theater. It should contain some info when is it occupied by a movie projection. I am thinking of a 2-dimensional array - for each day in the week and each hour of the day a boolean cell indicating whether or not a projection is taking place at that theater at the given time.

I'm a beginner. Been working on Workbench only, no manually written code.

(The database is part of a larger project for website using PHP and JS.)

도움이 되었습니까?

해결책

Personally I would go for the following approach:

  • a table movie_theater with all info about the movie theater (id, name, etc etc)
  • a table movie that holds all the movies that can be shown
  • a table projection that links a movie to a movie_theater and has a begin and end time_stamp

this way a projection is linked to a movie_theater and a movie. When generating a time table for a certain period you simply select all projections from a certain movie_theater from inbetween the given timestamps

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top