开发者

Convert SQL query into CakePHP pagination query

How can I use the following query:

SELEC开发者_开发问答T *
FROM `laps`
WHERE `id` = (
  SELECT `id`
  FROM `laps` AS `alt`
  WHERE `alt`.`user_id` = `laps`.`user_id`
  ORDER BY `lap_time` ASC
  LIMIT 1 )
ORDER BY `lap_time` ASC

in my CakePHP app and paginate the results?


what you actually want is how to do custom pagination query. there's some info about that here


convert your query to join way, then use cake custom pagination.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜