Class DB_result

Description

This class implements a wrapper for a DB result set.

A new instance of this class will be returned by the DB implementation after processing a query that returns data.

Located in /maintenance/libraries/pear/DB.php (line 767)


	
			
Variable Summary
 mixed $dbh
 integer $limit_count
 integer $limit_from
 mixed $result
 mixed $row_counter
Method Summary
 DB_result DB_result (resource &$dbh, resource $result, [array $options = array()])
 mixed fetchInto (array &$arr, [int $fetchmode = DB_FETCHMODE_DEFAULT], [int $rownum = null])
 array &fetchRow ([int $fetchmode = DB_FETCHMODE_DEFAULT], [int $rownum = null])
 int free ()
 integer getRowCounter ()
 bool nextResult ()
 int numCols ()
 int numRows ()
 void setOption (mixed $key, [mixed $value = null])
 void tableInfo ([mixed $mode = null])
Variables
mixed $dbh (line 771)
integer $limit_count = null (line 785)

for limit queries, the number of rows to fetch

integer $limit_from = null (line 779)

for limit queries, the row to start fetching

mixed $result (line 772)
mixed $row_counter = null (line 773)
Methods
Constructor DB_result (line 796)

DB_result constructor.

DB_result DB_result (resource &$dbh, resource $result, [array $options = array()])
  • resource &$dbh: DB object reference
  • resource $result: result resource id
  • array $options: assoc array with optional result options
fetchInto (line 933)

Fetch a row of data into an array which is passed by reference.

The type of array returned can be controlled either by setting this method's $fetchmode parameter or by changing the default fetch mode setFetchMode() before calling this method.

There are two options for standardizing the information returned from databases, ensuring their values are consistent when changing DBMS's. These portability options can be turned on when creating a new DB object or by using setOption().

  • DB_PORTABILITY_LOWERCASE convert names of fields to lower case
  • DB_PORTABILITY_RTRIM right trim the data

mixed fetchInto (array &$arr, [int $fetchmode = DB_FETCHMODE_DEFAULT], [int $rownum = null])
  • array &$arr: (reference) array where data from the row should be placed
  • int $fetchmode: how the resulting array should be indexed
  • int $rownum: the row number to fetch
fetchRow (line 849)

Fetch a row of data and return it by reference into an array.

The type of array returned can be controlled either by setting this method's $fetchmode parameter or by changing the default fetch mode setFetchMode() before calling this method.

There are two options for standardizing the information returned from databases, ensuring their values are consistent when changing DBMS's. These portability options can be turned on when creating a new DB object or by using setOption().

  • DB_PORTABILITY_LOWERCASE convert names of fields to lower case
  • DB_PORTABILITY_RTRIM right trim the data

array &fetchRow ([int $fetchmode = DB_FETCHMODE_DEFAULT], [int $rownum = null])
  • int $fetchmode: how the resulting array should be indexed
  • int $rownum: the row number to fetch
free (line 1039)

Frees the resources allocated for this result set.

  • return: error code
  • access: public
int free ()
getRowCounter (line 1072)

returns the actual row number

integer getRowCounter ()
nextResult (line 1025)

Get the next result if a batch of queries was executed.

  • return: true if a new result is available or false if not.
  • access: public
bool nextResult ()
numCols (line 995)

Get the the number of columns in a result set.

  • return: the number of columns, or a DB error
  • access: public
int numCols ()
numRows (line 1010)

Get the number of rows in a result set.

  • return: the number of rows, or a DB error
  • access: public
int numRows ()
setOption (line 809)
void setOption (mixed $key, [mixed $value = null])
tableInfo (line 1057)
void tableInfo ([mixed $mode = null])

Documentation generated on Thu, 20 Jan 2005 17:09:41 +0000 by phpDocumentor 1.3.0RC3