FIXME: Look over new file...

Here is an example of paging recordsets:

Usage:

<?php
        $dbh = & SGL_DB::singleton();
        $conf = & $GLOBALS['_SGL']['CONF'];
        $query = "SELECT preference_id, name, default_value FROM {$conf['table']['preference']}";
        $limit = $_SESSION['aPrefs']['resPerPage'];
        $pagerOptions = array(
            'mode'      => 'Sliding',
            'delta'     => 3,
            'perPage'   => $limit,
            'totalItems'=> $input->totalItems,
        );
        $aPagedData = SGL_DB::getPagedData($dbh, $query, $pagerOptions);
        $output->aPagedData = $aPagedData;
        if (is_array($aPagedData['data']) && count($aPagedData['data']] {
            $output->pager = ($aPagedData['totalItems'] <= $limit) ? false : true;
        }
?>