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

Class: MDB2_Result_Common

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


[ Top ]


Class Variables

$column_names =

[line 3355]


Type:   mixed


[ Top ]

$db =

[line 3347]


Type:   mixed


[ Top ]

$limit =

[line 3354]


Type:   mixed


[ Top ]

$offset =

[line 3352]


Type:   mixed


[ Top ]

$offset_count =  0

[line 3353]


Type:   mixed


[ Top ]

$result =

[line 3348]


Type:   mixed


[ Top ]

$rownum =  -1

[line 3349]


Type:   mixed


[ Top ]

$types = array()

[line 3350]


Type:   mixed


[ Top ]

$values = array()

[line 3351]


Type:   mixed


[ Top ]



Method Detail

MDB2_Result_Common (Constructor)   [line 3377]

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

PHP 4 Constructor

Parameters:

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

[ Top ]

__construct (Constructor)   [line 3363]

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

Constructor

Parameters:

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

[ Top ]

bindColumn   [line 3754]

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

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

mixed fetchCol( [int $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   $colnum   —  the column number to fetch

[ Top ]

fetchOne   [line 3478]

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

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

bool free( )

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

[ Top ]

getColumnNames   [line 3674]

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

resource getResource( )

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

[ Top ]

nextResult   [line 3652]

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

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

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

int rowCount( )

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

[ Top ]

seek   [line 3432]

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

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 15:01:22 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.