Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 php 页面中有 $i 计数器,所以我想直接从 $ith 行获取接下来的 15 条记录。我只是使用下面的查询 bt 它返回空输出。虽然我在 db 中有很多记录
SELECT * FROM BOOKS WHERE @ROWNUM > '$i' LIMIT 15
如果我理解正确,您想显示从 $i 开始的 15 行吗?
尝试:
SELECT * FROM tbl_name LIMIT $i,15
您可以将查询构建为
SELECT * FROM BOOKS LIMIT $i, 15;
检查此链接MySQL SELECT with LIMIT