query($sql))){ die (DB::errorMessage($res)); } // $from is received for example as url param: // http://www.host.com/list.php?from=50 // $limit is the number of rows you want to display per page if (isset($_GET['from'])){ $from=$_GET['from']; }else{ $from=0; } $limit = 10; $pager = new DB_Pager ($res, $from, $limit); // $data now contains all the data needed to build // for example, links and displaying info to the user $data = $pager->build(); if (DB::isError($data)){ die (DB::errorMessage($data)); }if (!$data) { die ('There were no results'); } // Display data (only few examples) echo '
'; echo $data['numrows'] . ' Results found'; echo '