Class dbrows

Description

DB Rows class Renders a query into data and allows access to the data either directly or via the usual get first,last,next,previous cursor navigation.

This class returns data as "rows" which is to say a standard array of data. For the associative array version then please

  • see: dbrecords NOTE: On creation, it executes the query and positions to the initial record (defaulted to the first).

Located in /query-defs.php (line 625)

sqlquery
   |
   --dbquery
      |
      --dbrows
Direct descendents
Class Description
 class dbrecords DB Records class Renders a query into data and allows access to the data either directly or via the usual get first,last,next,previous cursor navigation.
Variable Summary
 mixed $current_row
Method Summary
 dbrows dbrows ([string $sql = ""])
 boolean eof ()
 bool execute ()
 mixed get_current ()
 mixed get_first ()
 mixed get_last ()
 mixed get_next ()
 mixed get_previous ()
 mixed get_row (integer $rowno)
 void refresh ()
 bool rowexists (integer $rowno)
 bool set_sql (string $sql)
Variables
Methods
Constructor dbrows (line 634)

Constructor Create a new DB Rows object.

dbrows dbrows ([string $sql = ""])
  • string $sql: An SQL statement in full
eof (line 817)

Return the EOF (end-of-file) indicator for this query. Returns true if no more results can be returned with get_next(), ie. we are at the end of the results set.

  • return: True if we are at the end of the results set.
boolean eof ()
execute (line 647)

Execute query Execute this query. We override the parent method here simply to ensure we are positioned at the first row.

  • return: True if query was executed successfully
bool execute ()

Redefinition of:
dbquery::execute()
Exceute the query If we have an SQL phrase, execute it now. We store the result in this->valid, and also return it. If a transaction is open, update the status.
get_current (line 752)

Get current row If current query is invalid, try to execute it first, then do a get_first(). If query is then valid, return the current row.

mixed get_current ()
get_first (line 767)

Get current row If current query is invalid, try to execute it first, then do a get_first(). If query is then valid, return the current row.

mixed get_first ()
get_last (line 778)

Get last row If current query is invalid, try to execute it first, then get the last row from the resultset.

  • return: The row if it is available, else returns FALSE.
mixed get_last ()
get_next (line 803)

Get next row If current query is invalid, try to execute it first, then get the next row from the resultset.

  • return: The row if it is available, else returns FALSE.
mixed get_next ()
get_previous (line 789)

Get previous row If current query is invalid, try to execute it first, then get the previous row from the resultset.

  • return: The row if it is available, else returns FALSE.
mixed get_previous ()
get_row (line 691)

Get row Return the given database row from the resultset. Uses the get_row_raw() method applicable to this class.

  • return: The row if it is available, else returns FALSE.
  • see: get_row_raw()
mixed get_row (integer $rowno)
  • integer $rowno: The row number to return
refresh (line 739)

Refresh the query Re-run the current SQL query. If successful the row will be stored in $this->current_row.

void refresh ()
rowexists (line 725)

Returns true if the row number exists in the returned resultset.

The query has to be valid, and there have to be some rows in it.

  • return: True if the row is present in the current resultset
bool rowexists (integer $rowno)
  • integer $rowno: Number of the row, zero (0) is first row
set_sql (line 661)

Set the SQL statement In this case we re-execute the SQL automatically.

  • return: True if query was executed successfully
bool set_sql (string $sql)
  • string $sql: An SQL statement in full

Redefinition of:
dbquery::set_sql()
Set the SQL statement

Inherited Methods

Inherited From dbquery

 dbquery::dbquery()
 dbquery::execute()
 dbquery::set_sql()
 dbquery::tidyup()

Inherited From sqlquery

 sqlquery::sqlquery()
 sqlquery::build()
 sqlquery::clear()
 sqlquery::fieldlist()
 sqlquery::from()
 sqlquery::groupby()
 sqlquery::into()
 sqlquery::limit()
 sqlquery::offset()
 sqlquery::orderby()
 sqlquery::rebuild()
 sqlquery::set()
 sqlquery::tables()
 sqlquery::where()

Documentation generated by phpDocumentor 1.3.0RC3