When using Kohana DB, how does one avoid duplicate code when needing a count for pagination?
- 阅读更多 关于 When using Kohana DB, how does one avoid duplicate code when needing a count for pagination?
问题 Using the Kohana query builder, is it possible to build my query piece by piece. Then execute a count on said query. Then execute the query itself. All without having to write duplicate conditionals... one for the count and one for the results... Adding DB::select(array('COUNT("pid")', 'mycount')) To the main query results in only getting back one record. Is it maybe possible to execute the count, and somehow remove array('COUNT("pid")', 'mycount') from the select... Right now the only way I