views:

57

answers:

0

I'm working on a TV guide pagination script - the basic pagination function works properly, no issues there.

This is my current SQL query:

$result = mysql_query("SELECT programme, channel, airdate, expiration, 
episode, setreminder FROM mediumonair ORDER by airdate");

However, there's two issues with this script that I'm having trouble with:

  • Some records still stay after expiration

This is what the code looks like with the current script:

Medium showing on Channel 1 7:00pm "Joe Day Afternoon" Set Reminder
Medium showing on Channel 1 7:00pm "Joe Day Afternoon" Set Reminder
Medium showing on Channel 1 August 25th - 12:50am "Joe Day Afternoon" Set Reminder
Medium showing on Channel 1 August 26th - 2:30pm "The Man In The Mirror" Set Reminder
Medium showing on Channel 1 August 27th - 8:00pm "A Necessary Evil" Set Reminder

However, when the first record expired (8:00pm London time GMT) it remained, regardless of whether I used >= NOW(), >= CURDATE(), >= CURTIME() etc.

Also, should I use SELECT DISTINCT at all since I accidentally duplicated some records in the SQL (the first record, bizarrely, had to be duplicated, otherwise it only displayed the records for later on in the week!)

How should I handle this problem? I'm not sure how to find the solution, and despite trying, still can't work out how... all help is appreciated ;)

This is for a PHP/MySQL query on Apache, by the way.