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

Class: MDB2_Result_Common

Source Location: /MDB2-2.5.0b5/MDB2.php

Class Overview

MDB2_Result
   |
   --MDB2_Result_Common

The common result class for MDB2 result objects


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 3704]
The common result class for MDB2 result objects


[ Top ]


Class Variables

$column_names =

[line 3717]

  • Access: public

Type:   mixed


[ Top ]

$db =

[line 3708]

  • Access: public

Type:   mixed


[ Top ]

$limit =

[line 3716]

  • Access: public

Type:   mixed


[ Top ]

$offset =

[line 3714]

  • Access: public

Type:   mixed


[ Top ]

$offset_count =  0

[line 3715]

  • Access: public

Type:   mixed


[ Top ]

$result =

[line 3709]

  • Access: public

Type:   mixed


[ Top ]

$rownum =  -1

[line 3710]

  • Access: public

Type:   mixed


[ Top ]

$types = array()

[line 3711]

  • Access: public

Type:   mixed


[ Top ]

$types_assoc = array()

[line 3712]

  • Access: public

Type:   mixed


[ Top ]

$values = array()

[line 3713]

  • Access: public

Type:   mixed


[ Top ]



Method Detail

__construct (Constructor)   [line 3725]

MDB2_Result_Common __construct( $db, &$result, [ $limit = 0], [ $offset = 0])

Constructor

Parameters:

   $db     
   &$result     
   $limit     
   $offset     

[ Top ]

bindColumn   [line 4111]

mixed bindColumn( int $column, mixed &$value, [string $type = null])

Set bind variable to a column.
  • Return: MDB2_OK on success, a MDB2 error on failure
  • Access: public

Parameters:

int   $column     column number or name
mixed   &$value     variable reference
string   $type     specifies the type of the field

[ Top ]

fetchAll   [line 3905]

mixed fetchAll( [int $fetchmode = MDB2_FETCHMODE_DEFAULT], [bool $rekey = false], [bool $force_array = false], [bool $group = false])

Fetch and return all rows from the current row pointer position
  • Return: data array on success, a MDB2 error on failure
  • See: getAssoc()
  • Access: public

Parameters:

int   $fetchmode     the fetch mode to use:
  • MDB2_FETCHMODE_ORDERED
  • MDB2_FETCHMODE_ASSOC
  • MDB2_FETCHMODE_ORDERED | MDB2_FETCHMODE_FLIPPED
  • MDB2_FETCHMODE_ASSOC | MDB2_FETCHMODE_FLIPPED
bool   $rekey     if set to true, the $all will have the first column as its first dimension
bool   $force_array     used only when the query returns exactly two columns. If true, the values of the returned array will be one-element arrays instead of scalars.
bool   $group     if true, the values of the returned array is wrapped in another array. If the same key value (in the first column) repeats itself, the values will be appended to this array instead of overwriting the existing values.

[ Top ]

fetchCol   [line 3859]

mixed fetchCol( [int|string $colnum = 0])

Fetch and return a column from the current row pointer position
  • Return: data array on success, a MDB2 error on failure
  • Access: public

Parameters:

int|string   $colnum     the column number (or name) to fetch

[ Top ]

fetchOne   [line 3834]

string fetchOne( [int|string $colnum = 0], [int $rownum = null])

fetch single column from the next row from a result set
  • Return: data on success, a MDB2 error on failure
  • Access: public

Parameters:

int|string   $colnum     the column number (or name) to fetch
int   $rownum     number of the row where the data can be found

[ Top ]

fetchRow   [line 3815]

int fetchRow( [int $fetchmode = MDB2_FETCHMODE_DEFAULT], [int $rownum = null])

Fetch and return a row of data
  • Return: data array on success, a MDB2 error on failure
  • Access: public

Parameters:

int   $fetchmode     how the array data should be indexed
int   $rownum     number of the row where the data can be found

[ Top ]

free   [line 4164]

bool free( )

Free the internal resources associated with result.
  • Return: true on success, false if result is invalid
  • Access: public

[ Top ]

getColumnNames   [line 4031]

mixed getColumnNames( [bool $flip = false])

Retrieve the names of columns returned by the DBMS in a query result or from the cache.
  • Return: Array variable that holds the names of columns or an MDB2 error on failure. Some DBMS may not return any columns when the result set does not contain any rows.
  • Access: public

Parameters:

bool   $flip     If set to true the values are the column names, otherwise the names of the columns are the keys.

[ Top ]

getResource   [line 4092]

resource getResource( )

return the resource associated with the result object
  • Access: public

[ Top ]

nextResult   [line 4009]

true nextResult( )

Move the internal result pointer to the next available result
  • Return: on success, false if there is no more result set or an error object on failure
  • Access: public

[ Top ]

numCols   [line 4076]

mixed numCols( )

Count the number of columns returned by the DBMS in a query result.
  • Return: integer value with the number of columns, a MDB2 error on failure
  • Access: public

[ Top ]

numRows   [line 3993]

mixed numRows( )

Returns the number of rows in a result object
  • Return: MDB2 Error Object or the number of rows
  • Access: public

[ Top ]

rowCount   [line 3978]

int rowCount( )

Returns the actual row number that was last fetched (count from 0)
  • Access: public

[ Top ]

seek   [line 3789]

mixed seek( [int $rownum = 0])

Seek to a specific row in a result set
  • Return: MDB2_OK on success, a MDB2 error on failure
  • Access: public

Parameters:

int   $rownum     number of the row where the data can be found

[ Top ]

setResultTypes   [line 3757]

mixed setResultTypes( array $types)

Define the list of types to be associated with the columns of a given result set.

This function may be called before invoking fetchRow(), fetchOne(), fetchCol() and fetchAll() so that the necessary data type conversions are performed on the data to be retrieved by them. If this function is not called, the type of all result set columns is assumed to be text, thus leading to not perform any conversions.

  • Return: MDB2_OK on success, a MDB2 error on failure
  • Access: public

Parameters:

array   $types     variable that lists the data types to be expected in the result set columns. If this array contains less types than the number of columns that are returned in the result set, the remaining columns are assumed to be of the type text. Currently, the types clob and blob are not fully supported.

[ Top ]


Documentation generated on Mon, 29 Oct 2012 16:00:17 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.