Class DB_ifx

Description

Database independent query interface definition for PHP's Informix extension.

  • author: Tomas V.V.Cox <cox@idecnet.com>
  • version: $Id: ifx.php,v 1.47 2004/03/05 01:46:53 danielc Exp $

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

PEAR
   |
   --DB_common
      |
      --DB_ifx
Variable Summary
Method Summary
 DB_ifx DB_ifx ()
 number affectedRows ()
 void autoCommit ([mixed $onoff = true])
 void commit ()
 int connect ($dsn $dsninfo, [$persistent $persistent = false])
 bool disconnect ()
 int errorCode (string $nativecode)
 int errorNative ()
 mixed fetchInto (resource $result, array &$arr, int $fetchmode, [int $rownum = null])
 bool freeResult ($result $result)
 string getSpecialQuery (string $type)
 object DB ifxraiseError ([integer $errno = null])
 true nextResult (a $result)
 int numCols ($result $result)
 void numRows (mixed $result)
 void rollback ()
 int simpleQuery ($query $query)
 array tableInfo (object|string $result, [int $mode = null])
Variables
mixed $affected = 0 (line 48)
mixed $autocommit = true (line 51)
mixed $connection (line 47)
mixed $dsn = array() (line 49)
mixed $fetchmode = DB_FETCHMODE_ORDERED (line 52)

Redefinition of:
DB_common::$fetchmode
mixed $transaction_opcount = 0 (line 50)

Inherited Variables

Inherited from DB_common

DB_common::$dbh
DB_common::$errorcode_map
DB_common::$features
DB_common::$fetchmode_object_class
DB_common::$last_query
DB_common::$options
DB_common::$phptype
DB_common::$prepared_queries
DB_common::$prepare_maxstmt
DB_common::$prepare_tokens
DB_common::$prepare_types
Methods
Constructor DB_ifx (line 57)
DB_ifx DB_ifx ()
affectedRows (line 219)

Gets the number of rows affected by the last query.

if the last query was a select, returns 0.

  • return: of rows affected by the last query
number affectedRows ()

Redefinition of:
DB_common::affectedRows()
Returns the affected rows of a query
autoCommit (line 336)

Enable/disable automatic commits

void autoCommit ([mixed $onoff = true])

Redefinition of:
DB_common::autoCommit()
enable automatic Commit
commit (line 350)

Commit the current transaction.

void commit ()

Redefinition of:
DB_common::commit()
starts a Commit
connect (line 104)

Connect to a database and log in as the specified user.

  • return: DB_OK on success, a DB error code on failure
int connect ($dsn $dsninfo, [$persistent $persistent = false])
  • $dsn $dsninfo: the data source name (see DB::parseDSN for syntax)
  • $persistent $persistent: (optional) whether the connection should be persistent
disconnect (line 134)

Log out and disconnect from the database.

  • return: true on success, false if not connected.
bool disconnect ()
errorCode (line 417)

Map native error codes to DB's portable ones.

Requires that the DB implementation's constructor fills in the $errorcode_map property.

  • return: a portable DB error code, or DB_ERROR if this DB implementation has no mapping for the given error code.
int errorCode (string $nativecode)
  • string $nativecode: error code returned by the database

Redefinition of:
DB_common::errorCode()
Map native error codes to DB's portable ones
errorNative (line 437)

Get the native error message of the last error (if any) that occured on the current connection.

  • return: native Informix error code
int errorNative ()

Redefinition of:
DB_common::errorNative()
Returns an errormessage, provides by the database
fetchInto (line 250)

Fetch a row and insert the data into an existing array.

Formating of the array and the data therein are configurable. See DB_result::fetchInto() for more information.

  • return: DB_OK on success, null when end of result set is reached or on failure
  • access: private
  • see: DB_result::fetchInto()
mixed fetchInto (resource $result, array &$arr, int $fetchmode, [int $rownum = null])
  • resource $result: query result identifier
  • 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
freeResult (line 325)

Free the internal resources associated with $result.

  • return: true on success, false if $result is invalid
bool freeResult ($result $result)
  • $result $result: Informix result identifier
getSpecialQuery (line 450)

Returns the query needed to get some backend info

  • return: The SQL query string
string getSpecialQuery (string $type)
  • string $type: What kind of info you want to retrieve

Redefinition of:
DB_common::getSpecialQuery()
Returns the query needed to get some backend info
ifxraiseError (line 394)

Gather information about an error, then use that info to create a DB error object and finally return that object.

object DB ifxraiseError ([integer $errno = null])
  • integer $errno: PEAR error number (usually a DB constant) if manually raising an error
nextResult (line 205)

Move the internal ifx result pointer to the next available result

  • return: if a result is available otherwise return false
  • access: public
true nextResult (a $result)
  • a $result: valid fbsql result resource
numCols (line 307)

Get the number of columns in a result set.

  • return: the number of columns per row in $result
int numCols ($result $result)
  • $result $result: Informix result identifier
numRows (line 292)
void numRows (mixed $result)

Redefinition of:
DB_common::numRows()
Returns the number of rows in a result object
rollback (line 368)

Roll back (undo) the current transaction.

void rollback ()

Redefinition of:
DB_common::rollback()
starts a rollback
simpleQuery (line 154)

Send a query to Informix and return the results as a Informix resource identifier.

  • return: returns a valid Informix result for successful SELECT queries, DB_OK for other successful queries. A DB error code is returned on failure.
int simpleQuery ($query $query)
  • $query $query: the SQL query
tableInfo (line 482)

Returns information about a table or a result set.

NOTE: only supports 'table' if $result is a table name.

If analyzing a query result and the result has duplicate field names, an error will be raised saying can't distinguish duplicate field names.

  • return: an associative array with the information requested or an error object if something is wrong
  • see: DB_common::tableInfo()
  • since: 1.6.0
  • internal:
  • access: public
array tableInfo (object|string $result, [int $mode = null])
  • object|string $result: DB_result object from a query or a string containing the name of a table
  • int $mode: a valid tableInfo mode

Redefinition of:
DB_common::tableInfo()
Returns information about a table or a result set

Inherited Methods

Inherited From DB_common

 DB_common::DB_common()
 DB_common::affectedRows()
 DB_common::autoCommit()
 DB_common::autoExecute()
 DB_common::autoPrepare()
 DB_common::buildManipSQL()
 DB_common::commit()
 DB_common::createSequence()
 DB_common::dropSequence()
 DB_common::errorCode()
 DB_common::errorMessage()
 DB_common::errorNative()
 DB_common::escapeSimple()
 DB_common::execute()
 DB_common::executeEmulateQuery()
 DB_common::executeMultiple()
 DB_common::freePrepared()
 DB_common::getAll()
 DB_common::getAssoc()
 DB_common::getCol()
 DB_common::getListOf()
 DB_common::getOne()
 DB_common::getOption()
 DB_common::getRow()
 DB_common::getSequenceName()
 DB_common::getSpecialQuery()
 DB_common::getTables()
 DB_common::limitQuery()
 DB_common::modifyLimitQuery()
 DB_common::modifyQuery()
 DB_common::nextId()
 DB_common::numRows()
 DB_common::prepare()
 DB_common::provides()
 DB_common::query()
 DB_common::quote()
 DB_common::quoteIdentifier()
 DB_common::quoteSmart()
 DB_common::quoteString()
 DB_common::raiseError()
 DB_common::rollback()
 DB_common::setFetchMode()
 DB_common::setOption()
 DB_common::tableInfo()
 DB_common::toString()
 DB_common::_convertNullArrayValuesToEmpty()
 DB_common::_rtrimArrayValues()

Documentation generated on Fri, 10 Dec 2004 18:25:40 +0000 by phpDocumentor 1.3.0RC3