2010-05-28 67 views
1

這是我的分頁腳本,它爲我正在處理的電視指南項目提取信息。 目前我已經試用了不同的PHP/MySQL,然後它變成了一個生產站點。第一條記錄不會在分頁腳本中顯示

這是我當前的腳本:

<?php 
include("pmcPagination.php");     
$paginator = new pmcPagination(20, "page");    
mysql_connect("localhost","root","PASSWORD"); 
mysql_select_db("mytvguide"); 

//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'], 
     $row['channel'], 
     $row['airdate'], 
     $row['expiration'], 
     $row['episode'], 
     $row['setreminder'])); 
} 

//Show the paginated results 
$paginator->paginate(); 

include("pca-footer1.php"); 

//Show the navigation 
$paginator->navigation(); 

儘管我有兩個記錄今天播出的節目,那隻能說明從開始第二個記錄 - 即在播出下午8:35英國時間GMT做節目不顯示,但晚英國時間晚11:25分格林威治標準時間顯示。

我該如何解決這個問題?以上是我的代碼,如果這是任何使用!

由於

+0

您的訂單條款中的「3 ASC」是什麼?這可能是問題的一部分。 – GSto 2010-05-28 18:58:52

回答

1

SELECT節目,頻道,廣播時間日期,到期 ,插曲,setreminder FROM 拉古納海灘其中到期> =現在() 以便通過廣播日,3 ASC LIMIT 0,100;

您正在同一列上排序兩次。 airdate和3是你的sql select語句中的同一列。

+0

我將它改爲$ result = mysql_query(「SELECT program,channel,airdate,expiration,episode,setreminder FROM lagunabeach where expiration> = now()order by airdate;」);但第一張唱片仍然沒有顯示。 – whitstone86 2010-05-31 18:35:45

相關問題