【发布时间】:2019-03-01 21:32:24
【问题描述】:
我需要使用“限制”从数据库中获取数据,如何在 laravel 中做到这一点?雄辩的
->limit($value)
只取一个值,但我需要一个范围。我的意思是,例如在我发送 starting point 和 range 的请求中:
0 and 10 (i want to start getting records from first and get next 10)
然后
10 and 10 (i want to start getting records from 10th and get next 10)
在 MySQL 查询中可以生成LIMIT 0, 10 / LIMIT 10, 10
从 laravel 中做到这一点的方法是什么? ->limit(0,10)?
【问题讨论】:
-
请mark one of the answers as accepted。这会向其他用户显示问题已解决。
标签: php mysql laravel laravel-query-builder