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

Class: MDB2_Result_Common

Source Location: /MDB2-2.0.3/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 2933]
The common result class for MDB2 result objects


[ Top ]


Class Variables

$column_names =

[line 2944]


Type:   mixed


[ Top ]

$db =

[line 2936]


Type:   mixed


[ Top ]

$limit =

[line 2943]


Type:   mixed


[ Top ]

$offset =

[line 2941]


Type:   mixed


[ Top ]

$offset_count =  0

[line 2942]


Type:   mixed


[ Top ]

$result =

[line 2937]


Type:   mixed


[ Top ]

$rownum =  -1

[line 2938]


Type:   mixed


[ Top ]

$types = array()

[line 2939]


Type:   mixed


[ Top ]

$values = array()

[line 2940]


Type:   mixed


[ Top ]



Method Detail

__construct (Constructor)   [line 2952]

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

Constructor

Parameters:

   &$db   — 
   &$result   — 
   $limit   — 
   $offset   — 

[ Top ]

MDB2_Result_Common (Constructor)   [line 2966]

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

PHP 4 Constructor

Parameters:

   &$db   — 
   &$result   — 
   $limit   — 
   $offset   — 

[ Top ]

bindColumn   [line 3341]

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 3136]

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

Fetch and return a column of data (it uses fetchRow for that)
  • 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 3091]

mixed fetchCol( [int $colnum = 0])

Fetch and return a column of data (it uses current for that)
  • Return: data array on success, a MDB2 error on failure
  • Access: public

Parameters:

int   $colnum   —  the column number to fetch

[ Top ]

fetchOne   [line 3066]

string fetchOne( [int $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   $colnum   —  the column number to fetch
int   $rownum   —  number of the row where the data can be found

[ Top ]

fetchRow   [line 3046]

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 3394]

bool free( )

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

[ Top ]

getColumnNames   [line 3262]

mixed getColumnNames( )

Retrieve the names of columns returned by the DBMS in a query result or from the cache.
  • Return: associative array variable that holds the names of columns. The indexes of the array are the column names mapped to lower case and the values are the respective numbers of the columns starting from 0. Some DBMS may not return any columns when the result set does not contain any rows. a MDB2 error on failure
  • Access: public

[ Top ]

getResource   [line 3323]

resource getResource( )

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

[ Top ]

nextResult   [line 3239]

true nextResult( a 0)

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

Parameters:

a   0   —  valid result resource

[ Top ]

numCols   [line 3307]

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 3221]

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 3206]

int rowCount( )

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

[ Top ]

seek   [line 3020]

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 2995]

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, 11 Mar 2019 14:40:04 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.