public function getLimit($sql, $page, $num = 0, $params = array(), $next_page = false)
    {
        $num = (int)$num;
        $sql .= ' limit :limit_from,:limit';

        if ($next_page && $num) {
            $limit_from = ($page - 1) * ($num - 1);
        } else {
            $limit_from = ($page - 1) * $num;
        }

        $ret = $this->getAll($sql, array_merge($params, array('limit' => $num, 'limit_from' => $limit_from)));
        return $ret;
    }
public function getLimit($sql, $page, $num = 0, $params = array(), $next_page = false)
    {
        $num = (int)$num;
        $sql .= ' limit :limit_from,:limit';

        if ($next_page && $num) {
            $limit_from = ($page - 1) * ($num - 1);
        } else {
            $limit_from = ($page - 1) * $num;
        }

        $ret = $this->getAll($sql, array_merge($params, array('limit' => $num, 'limit_from' => $limit_from)));
        return $ret;
    }
public function getLimit ( $ sql , $ page , $ num = 0 , $ params = array ( ) , $ next_page = false ) { $ num = ( int ) $ num ; $ sql .= ' limit :limit_from,:limit' ; if ( $ next_page && $ num ) { $ limit_from = ( $ page - 1 ) * ( $ num - 1 ) ; } else { $ limit_from = ( $ page - 1 ) * $ num ; } $ ret = $ this -> getAll ( $ sql , array_merge ( $ params , array ( 'limit' => $ num , 'limit_from' => $ limit_from ) ) ) ; return $ ret ; }
Get limit reulst

@param       $sql
@param       $page
@param int   $num
@param array $params
@param bool  $next_page

@return array
Get limit reulst