DB
[ class tree: DB ] [ index: DB ] [ all elements ]

Class: DB_result

Source Location: /DB-1.6.2/DB.php

Class Overview


This class implements a wrapper for a DB result set.


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 767]
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.



[ Top ]


Class Variables

$dbh =

[line 771]


Type:   mixed


[ Top ]

$limit_count =  null

[line 785]

for limit queries, the number of rows to fetch

Type:   integer


[ Top ]

$limit_from =  null

[line 779]

for limit queries, the row to start fetching

Type:   integer


[ Top ]

$result =

[line 772]


Type:   mixed


[ Top ]

$row_counter =  null

[line 773]


Type:   mixed


[ Top ]



Method Detail

DB_result (Constructor)   [line 796]

DB_result DB_result( resource &$dbh, resource $result, [array $options = array()])

DB_result constructor.

Parameters:

resource   &$dbh   —  DB object reference
resource   $result   —  result resource id
array   $options   —  assoc array with optional result options

[ Top ]

fetchInto   [line 933]

mixed fetchInto( array &$arr, [int $fetchmode = DB_FETCHMODE_DEFAULT], [int $rownum = null])

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


Parameters:

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

[ Top ]

fetchRow   [line 849]

array &fetchRow( [int $fetchmode = DB_FETCHMODE_DEFAULT], [int $rownum = null])

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


Parameters:

int   $fetchmode   —  how the resulting array should be indexed
int   $rownum   —  the row number to fetch

[ Top ]

free   [line 1039]

int free( )

Frees the resources allocated for this result set.
  • Return: error code
  • Access: public

[ Top ]

getRowCounter   [line 1072]

integer getRowCounter( )

returns the actual row number

[ Top ]

nextResult   [line 1025]

bool nextResult( )

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

[ Top ]

numCols   [line 995]

int numCols( )

Get the the number of columns in a result set.
  • Return: the number of columns, or a DB error
  • Access: public

[ Top ]

numRows   [line 1010]

int numRows( )

Get the number of rows in a result set.
  • Return: the number of rows, or a DB error
  • Access: public

[ Top ]

setOption   [line 809]

void setOption( $key, [ $value = null])


Parameters:

   $key   — 
   $value   — 

[ Top ]

tableInfo   [line 1057]

void tableInfo( [ $mode = null])


Parameters:

   $mode   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 10:14:51 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.