SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: TV Guide

  1. #1
    SitePoint Evangelist AlexC's Avatar
    Join Date
    Oct 2000
    Location
    Sheffield, UK
    Posts
    437
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    I Am doing some work for a client and need to create them a TVGuide script that will enable them to enter the listings for the week ahead through a web based interface

    Does anyone have any advice on how i could do it? PHP is the only option as i dont know any other languages

    Tia

    Alex
    Nearly 7 years old!

  2. #2
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Are you familiar with writing database-driven pages using MySQL and PHP? If so, I'm not sure what kind of advice you're looking for.

    If not, check out my article on the subject: http://www.webmasterbase.com/article.php/228
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  3. #3
    SitePoint Evangelist AlexC's Avatar
    Join Date
    Oct 2000
    Location
    Sheffield, UK
    Posts
    437
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yea, i have read that

    i mean, if i use mysql...how do i put the data in? have a record for 5am..6am...7am and so on...or what?

    Thanls
    A;ex
    Nearly 7 years old!

  4. #4
    SitePoint Enthusiast
    Join Date
    Dec 2000
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    make a table called programs and put these colums in it

    day
    programstart (in 353545435 time format)
    programend (in 343434 time format)
    programname
    programdetails

    then when you call the day you have

    SELECT programstart,programend,programname,programdetails FROM programs WHERE day='Monday' ORDER BY programstart

    then in the while loop you just get it to decode the date numbers into the format you want and also display the info
    Last edited by Graeme; Feb 21, 2001 at 15:38.
    Need a CGI Script ?? checkout CGI-Scripting

  5. #5
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Graeme
    programstart (in 353545435 time format)
    programend (in 343434 time format)

    then in the while loop you just get it to decode the date numbers into the format you want and also display the info
    The above is a very common mistake in database design. MySQL has full support for storing dates and times and functions for formatting these values in your SELECT queries. Why make your PHP script do all the work of decoding and interpreting such values when MySQL provides highly optimized methods for doing all of these?
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  6. #6
    SitePoint Enthusiast
    Join Date
    Dec 2000
    Posts
    60
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    becuase if you store it like 56565656 then when you get the select query to order the programs by time it can order them better
    Need a CGI Script ?? checkout CGI-Scripting

  7. #7
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I don't know what you mean. MySQL's ORDER BY clause works just fine on date/time columns.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference


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
  •