morgan / kohana-paginate

Paginate abstraction supporting Database, ORM, ORM-REST and Dispatch.
MIT License
23 stars 11 forks source link

Pages & fixes #11

Open saruman opened 9 years ago

saruman commented 9 years ago

Get total pages and paginate by page.

$data = DB::select()->from('table');

$data = Paginate::factory($data)->page(1, 10)->execute();

$result = $data->result();
$total_pages = $data->count_pages();

Also, remove mysql_real_escape_string (conflict with mysqli).