Class QueryResult

Description

A QueryResult captures the result of a SELECT statement.

QueryResults are used to pass data from the database around to data consumers.

  • internal: Note that the QueryResult pulls all the rows from the returned result resource at creation time. Therefore do not request data that you don't need. SELECT count(*) FROM ... is greatly prefered from SELECT * FROM ... and then getting the number of rows if all you need is the number of rows.

Located in /include/classes/database/QueryResult.inc (line 26)


	
			
Variable Summary
 string $error
 array $results
 int $rows
Method Summary
 QueryResult QueryResult ()
 void addRow (array $row)
 mixed getError ()
 array getRowAt (int $index)
 int numRows ()
 void setError (string $error)
Variables
string $error (line 45)

captured error message

  • access: private
array $results (line 39)

full data from the DB

  • access: private
int $rows (line 33)

number of rows in this QueryResult

  • access: private
Methods
Constructor QueryResult (line 50)

QueryResult constructor

QueryResult QueryResult ()
addRow (line 91)

Appends a row to the stored result

  • internal: This is normally only called from DB::query.
void addRow (array $row)
  • array $row: The new row to add to the QueryResult
getError (line 70)

Checks the error message

  • return: the error message, if set, or 0, otherwise
mixed getError ()
getRowAt (line 101)

Returns the request row, without error checking

  • return: an associated and integered index array of rows
array getRowAt (int $index)
  • int $index: which row (zero-indexed) to return
numRows (line 81)

Return the number of rows in the QueryResult

  • return: the number of rows
  • internal: This may be non-zero even when $error is set
int numRows ()
setError (line 61)

Sets the error message

void setError (string $error)
  • string $error: an error messge from the database

Documentation generated on Tue, 25 Apr 2006 13:08:45 -0400 by phpDocumentor 1.3.0RC3