public function get($table, $cols, $options = array(), $distinct = false, $total_rows = false)
    {
        // Get Data
        $rows = array();
        $result = $this->select($table, $cols, $options, $distinct, $total_rows);
        while ($row = $result->fetch(\PDO::FETCH_ASSOC)) {
            $rows[] = $row;
        }
        $num = count($rows);

        // Total rows?
        if ($total_rows) {
            $result = $this->doQuery('SELECT FOUND_ROWS()');
            list ($total_rows) = $result->fetch(\PDO::FETCH_NUM);
        } else {
            $total_rows = $num;
        }

        // Return the result
        return array(
            'data' => $rows,
            'num' => $num,
            'num_all' => $total_rows,
        );
    }
public function get($table, $cols, $options = array(), $distinct = false, $total_rows = false)
    {
        // Get Data
        $rows = array();
        $result = $this->select($table, $cols, $options, $distinct, $total_rows);
        while ($row = $result->fetch(\PDO::FETCH_ASSOC)) {
            $rows[] = $row;
        }
        $num = count($rows);

        // Total rows?
        if ($total_rows) {
            $result = $this->doQuery('SELECT FOUND_ROWS()');
            list ($total_rows) = $result->fetch(\PDO::FETCH_NUM);
        } else {
            $total_rows = $num;
        }

        // Return the result
        return array(
            'data' => $rows,
            'num' => $num,
            'num_all' => $total_rows,
        );
    }
public function get ( $ table , $ cols , $ options = array ( ) , $ distinct = false , $ total_rows = false ) { // Get Data $ rows = array ( ) ; $ result = $ this -> select ( $ table , $ cols , $ options , $ distinct , $ total_rows ) ; while ( $ row = $ result -> fetch ( \ PDO :: FETCH_ASSOC ) ) { $ rows [ ] = $ row ; } $ num = count ( $ rows ) ; // Total rows? if ( $ total_rows ) { $ result = $ this -> doQuery ( 'SELECT FOUND_ROWS()' ) ; list ( $ total_rows ) = $ result -> fetch ( \ PDO :: FETCH_NUM ) ; } else { $ total_rows = $ num ; } // Return the result return array ( 'data' => $ rows , 'num' => $ num , 'num_all' => $ total_rows , ) ; }
get data from database
@param $table
@param $cols
@param array $options
@param bool $distinct
@param bool $total_rows
@return array
@throws \ErrorException
get data from database