Should I use DATE and TIME as fields rather than DATETIME
Posted
by whitstone86
on Stack Overflow
See other posts from Stack Overflow
or by whitstone86
Published on 2010-05-22T11:11:26Z
Indexed on
2010/05/22
11:20 UTC
Read the original article
Hit count: 209
I have a project on going for a TV guide, called mytvguide in the database - I use PHPMyAdmin. This is the structure for one table, which is called tvshow1:
Field Type
channel varchar(255)
date date No
airdate time No
expiration time No
episode varchar(255)
setreminder varchar(255)
but am not sure how to get DATE, TIME to work with the pagination script (below is the script, which works for the version with DATETIME): http://pastebin.com/6S1ejAFJ
However, although the DATETIME one works - it shows programmes that air on the day itself like this:
Programme 1 showing on Channel 1 2:35pm "Episode 2" Set Reminder
Programme 1 showing on Channel 1 May 26th - 12:50pm "Episode 3" Set Reminder
Programme 1 showing on Channel 1 May 26th - 5:55pm "Episode 3" Set Reminder
but I'm not quite sure how to replicate that for the fields that use DATE, TIME functions as seen above.
Any advice on this is appreciated, thanks!
© Stack Overflow or respective owner