2010-05-28 18:46



This is my pagination script which extracts info for my TV guide project that I am working on. Currently I've been experimenting with different PHP/MySQL before it becomes a production site.

This is my current script:

$paginator = new pmcPagination(20, "page");             

//Select only results for today and future
$result = mysql_query("SELECT programme, channel, airdate, expiration, episode, setreminder
                       FROM lagunabeach
                       WHERE expiration >= now() 
                       ORDER BY airdate, 3 ASC
                       LIMIT 0, 100;");

//You can also add results to paginate here
mysql_data_seek($queryresult, 0);

while($row = mysql_fetch_array($result)) {
    $paginator->add(new paginationData($row['programme'],

//Show the paginated results


//Show the navigation

Despite me having two records for the programmes airing today, it only shows records from the second one onwards - the programme that airs at 8:35pm UK time GMT does not show, but the later 11:25pm UK time GMT one does show.

How should I fix this? Above is my code if that is of any use!


  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • duanlei1957 duanlei1957 11年前

    SELECT programme, channel, airdate, expiration, episode, setreminder FROM lagunabeach where expiration >= now() order by airdate, 3 ASC LIMIT 0, 100;

    You are ordering by the same column twice. airdate and 3 are the same column in your sql select statement.

    点赞 评论 复制链接分享