这是我的问题,到目前为止我得到了这个脚本:
$result = mysql_query(
"SELECT *
FROM $tableVideos
ORDER BY VideoTimestamp DESC
LIMIT 6"
) or die(mysql_error());
这将使我可以向我的网站显示 6 个最新上传的视频。
但是我怎么能有 6 个限制,从第 6 个最新视频开始,一直到 12 个?这样,我可以显示 6 个视频并制作下一个按钮来显示接下来的 6 个视频。
您目前需要LIMIT 6
才能获得前 6 个结果。 如果您使用
LIMIT a,b
然后,您将从a
日开始获得b
个项目。
你想要
LIMIT 6,6
意思是"从第 6 个条目开始,再给我 6 个"。
阅读更多关于它的信息。
使用这个:
$result = mysql_query("SELECT * FROM $tableVideos ORDER BY VideoTimestamp DESC LIMIT 6,6") or die(mysql_error());
Actually Limit function have two paramter :
one is limit of record and second is start from where.
result = mysql_query("SELECT * FROM $tableVideos ORDER
BY VideoTimestamp DESC LIMIT 6,6") or die(mysql_error());