duan198299 2010-05-28 18:46
浏览 53
已采纳

第一条记录不会显示在分页脚本中

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:

<?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();

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!

Thanks

  • 写回答

1条回答 默认 最新

  • duanlei1957 2010-05-28 18:58
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 正弦信号发生器串并联电路电阻无法保持同步怎么办
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)