【发布时间】:2010-05-28 18:46:06
【问题描述】:
这是我的分页脚本,它为我正在处理的电视指南项目提取信息。 目前,在它成为生产站点之前,我一直在尝试不同的 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 播出的节目没有显示,但英国时间格林威治标准时间晚上 11:25 播出的节目没有显示,但后来的英国时间格林威治标准时间晚上 11:25 播出的一个确实显示。
我应该如何解决这个问题?以上是我的代码,如果有任何用处!
谢谢
【问题讨论】:
-
order by 子句中的“3 ASC”是怎么回事?这可能是问题的一部分。
标签: php mysql pagination