SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2009
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    complicated list query episodes and seasons

    I am wondering if it is possible to do this query without creating an additional table..
    essentially what I have is a list of shows, but think of them as episodes on a tv series, say, and one of the columns is show_season.
    I want to know if there would be a way to list like

    Season 5-heading
    -ep1 name date link etc
    -ep2
    -ep3
    Season 4-heading
    -ep1
    -ep2
    -ep3

    Ideally I don't want seasons table, so that when the client adds a 'season 6' it will automatically be put at the top. Also curious about doing the same thing just divided by year instead of season based on the already existing show_date.

    What I know of mysql and php right now is pretty basic so I don't even know whether this is really possible.
    If it would require a relational database, would there be a way to automate it that's fairly straightforward?

    regards

  2. #2
    SitePoint Wizard guelphdad's Avatar
    Join Date
    Oct 2003
    Location
    St. Catharines, ON Canada
    Posts
    1,708
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You would handle with two columns in your table as suggested
    Season and Episode

    you would handle the layout you are looking for in your front end application.

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2009
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok yeah, I know that.. I guess I should be posting in php instead. Thought it'd be query related, but I don't even know where exactly the line between php and mysql gets drawn

  4. #4
    SitePoint Wizard guelphdad's Avatar
    Join Date
    Oct 2003
    Location
    St. Catharines, ON Canada
    Posts
    1,708
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    think of php (or any front end application) as displaying or tidying and displaying the data.

    mysql (or any database) is used for manipulating the data to give you the result set needed, though not necessarily in the final format you are going to use it.


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
  •