SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jun 2003
    Location
    USA
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with theory behind this kind of db.

    Hi,

    I'm working on a review database. I'm havng trouble understanding the concept behind something like this. Let me be more specific. I want to understand, currently I don't

    I have 3 'main' directories (or categories) - 'Movies, TV, Books'. Let me use 'TV' as my example. 'TV' has a sub category to list the 'TV shows' that I will review. Lets say I pick 'TV show #1', that then has a sub category displaying all the seasons of that TV show. Lets say that I pick 'TV show #1 - Season 2', that will have a sub category listing all the episodes in that season, then finally when you click whichever episode you want to see, it will display my review content.

    I think this is too complicated because I'm a pretty new to this, but maybe you can help me understand the concept behind this. Here is my basic understanding, I think I need to have all this data in seperate tables first of all, all my categories in one table, here is where my breakdown occurs, how do I set up the sub categories, and then the sub sub categories, then all the review content. Is it possible to have a set up like this all on one page (similar to the column view in Mac OSX)?

  2. #2
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is really interesting

    OK, one table for types of media (movie, tv, book etc) is easy, but what is the best way to handle seasons and episodes? "Season" isn't applicable for movies and books, but "Episode" (or "Part") makes sense, in some cases.
    Well, I think this is the way I would do it:
    First create one table for "works of art" or whatever you want to call a book, a TV show etc, and then create tables for seasons and episodes
    Every work of art has media type id as foreign key, if the work is divided into seasons there will be one or more rows in the season table with work id as foreign key, and in the episode table the work id and/or season id is foreign key
    If season id is null in the episode table, then the work isn't divided into seasons, only episodes (e.g. a film trilogy)

    Another question is: How to arrange e.g. different media types in sub categories (parents/children)
    You will find help in this article: http://www.sitepoint.com/article/1105

    You could have flags (true/false, 1/0) in the media type table to store if a certain media type is "allowed" to have seasons or episodes
    For example, a book doesn't have seasons, only episodes (in some cases), while a magazine has

  3. #3
    SitePoint Member
    Join Date
    Jun 2003
    Location
    USA
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi jofa, thought I died there eh?

    First, thanks for your help! I totally understand what you are saying. I've been doing the relational database cram-a-thon for a couple of days now, so it's kinda fresh in my mind. I suppose my only 'real' problem now is the php part. I'm currently putting the article you directed me to through it's paces, trying to implement it with my thing.

    I'm just curious, would you consider something like this 'beginner', 'intermediate', or 'advanced'. I just wondering how much I've bitten off, I'm still a beginner, the only script I've 'written' is a basic add news/edit/delete script, and that was following a tutorial for the most part (but I do understand it!). Just curious if there are any tutorials similar to this thing I'm trying to create, but not as complex, I feel like I'm struggling a bit, thanks.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •