Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2010
    Posts
    39

    Unanswered: how to show weekly repeating programs in time and day bases (not date)

    i want to show the programs on day basis like 'sunday's programs' etc that repeats weekly, based on weekday and time only (avoiding date), i am making a a small application where updating 24 hours programs on daily basis is impossible, but it repeats weekly.

    will time works without date in mysql ?, should i add 'day' field ?

    Code:
    CREATE TABLE `programs` (
    `id` INT( 11 ) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
    `program_name` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
    `start_time` DATETIME NOT NULL  default 0000-00-00 00:00:00,
    `end_time` DATETIME NOT NULL default 0000-00-00 00:00:00,
    ) ENGINE = InnoDB;

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    how do you know if a program repeats or is in a series? Ive a sneaking suspiscion that you need to revisit your table design, applying the tools of normalisation to your design requirements. I think you need to have a clear idea of what your application is about, before you start comitting to code, and not chop and change the design seemingly on a whim

    don't understand
    i am making a a small application where updating 24 hours programs on daily basis is impossible, but it repeats weekly.
    why is it impossible?
    is that becuase you don't know that far out
    or
    you don't want to go to the trouble of defining individual programs.

    will time works without date in mysql ?, should i add 'day' field ?
    I though we had already gone through this with your earlier question
    what would adding a "day" column give you?

    don't understand
    will time works without date in mysql ?
    Right now I think you need to read up on date time finctions in MySQL.

    I think you need to get to grips with how MySQL stores date / time values, from there you should be able to work out the pathway you want to go.

    I suppose one of the fundamental questions is about how you treat a specific program
    is it a one off, is it one of a series
    do you need to know a series are you happy with say program X is always on on a Sunday between 10:00 and 10:59
    alternativley you could make an assertion that Channel Y always has programs of a specific genre at a specific time on a specific day, and therefore the actual program itrself is relatively minor importance.
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jul 2010
    Posts
    39
    Quote Originally Posted by healdem View Post
    is it a one off, is it one of a series
    do you need to know a series are you happy with say program X is always on on a Sunday between 10:00 and 10:59
    yes, the programs repeats on specific time, say pragram ABC is runs between 1:PM to 2 PM this saturday, it will repeat every next saturday, if in case that changes , i can edit it but I don't need to add everyday. Almost all programs repeats everyweek.

    That is why i was thinking to put 'time' datatype instead of 'datetime' in (start_tinme and end_time) and --> add 'day' so that show the programs according to that day.

    what do you suggest sir ?

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so what happens if the broadcaster delays programs or reschedules programs. what happens if a programs drages on longer than planned or expected (eg an overunnign sports or news programmes).
    what happens if you need to extend the data on the programme (eg include a synopsis of what the progrma is, say a reference to IMDB or similar.

    my gut feeling is that your front end, the thing that stuffs the programs in should have the option to add multiple rows across the days/weeks months (arguably years or decades in the case of 'Friends')

    eg you define the programme, you defien its day and timeslot, then you allow the definition of either a repeat (say programs X is repeated in two days time at 22:00, fur days time at 23:00) or part of a series (say there are 13 programmes in this series, so go out and create 12 'copies' of this listing out over the next 12 weeks.

    not knowing what your assignment is but I'd expect a central definitive listing containing details of all programmes for all channels. I'd expect another table to contain details of the programmes, and that links to the listings using the programmes PK. you may need an itme in your lisitngs which identifies which number programmes thi is in the series, possibly a numericx and work out someway of showing what series and what ID within eg 3.14 could indicate series 3 programme 14. just as equally it could be 314, but I think the 3.14 notation will probably serve you better. heck you may even need a table to contain details of channels (eg antenna, frequemcy, channle number and so on. if its a satellite station then maybe another table to identify the satellites physical orbit. you could go on, you may need to add a defintion of the source of the channes (is it terrestial (analogue or digitial, is it cable, is it satellite...)
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Jul 2010
    Posts
    39
    well it's not that complicated. I just need programmes to be repeated every week, they don't change that frequently.

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so if its not that complicated...
    how do you propsoe to model it?
    how do you propose to populate the tables?
    how do you propose to integrate series of programs with other programs
    what is the justification for switching to series from the original design of a listings table

    What actually is the purpose of htis application, what are you trying to achieve. waht are the requirements. I think you need to clearly resolve those issues so that you are clear in your own mind as to what youneed to do to accomplish those requirements
    I'd rather be riding on the Tiger 800 or the Norton

Tags for this Thread

Posting Permissions

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