public function select(
        $table,
        $conditions = null,
        $fields = null,
        $order = null,
        $limit = null,
        $offset = null
    )
    {
        if (is_null($fields)) {
            $fields = "*";
        }

        $queryString = "SELECT {$fields} FROM {$table} ";

        if (!is_null($conditions)) {
            $queryString .= "WHERE {$conditions} ";
        }

        if (!is_null($order)) {
            $queryString .= "ORDER BY {$order} ";
        }

        if (!is_null($limit)) {
            $queryString .= "LIMIT {$limit} ";
        }

        if (!is_null($offset) && !is_null($limit)) {
            $queryString .= "OFFSET {$offset} ";
        }


        $queryString .= ";";

        $this->query($queryString);

        return $this->countRows();
    }
public function select(
        $table,
        $conditions = null,
        $fields = null,
        $order = null,
        $limit = null,
        $offset = null
    )
    {
        if (is_null($fields)) {
            $fields = "*";
        }

        $queryString = "SELECT {$fields} FROM {$table} ";

        if (!is_null($conditions)) {
            $queryString .= "WHERE {$conditions} ";
        }

        if (!is_null($order)) {
            $queryString .= "ORDER BY {$order} ";
        }

        if (!is_null($limit)) {
            $queryString .= "LIMIT {$limit} ";
        }

        if (!is_null($offset) && !is_null($limit)) {
            $queryString .= "OFFSET {$offset} ";
        }


        $queryString .= ";";

        $this->query($queryString);

        return $this->countRows();
    }
public function select ( $ table , $ conditions = null , $ fields = null , $ order = null , $ limit = null , $ offset = null ) { if ( is_null ( $ fields ) ) { $ fields = "*" ; } $ queryString = "SELECT {$fields} FROM {$table} " ; if ( ! is_null ( $ conditions ) ) { $ queryString .= "WHERE {$conditions} " ; } if ( ! is_null ( $ order ) ) { $ queryString .= "ORDER BY {$order} " ; } if ( ! is_null ( $ limit ) ) { $ queryString .= "LIMIT {$limit} " ; } if ( ! is_null ( $ offset ) && ! is_null ( $ limit ) ) { $ queryString .= "OFFSET {$offset} " ; } $ queryString .= ";" ; $ this -> query ( $ queryString ) ; return $ this -> countRows ( ) ; }
Perform a SELECT statement

@param string $table
@param string $conditions
@param string $fields
@param string $order
@param string $limit
@param string $offset

@return int number of affected rows
Perform a SELECT statement