[line 54]
The methods PEAR DB uses to interact with PHP's ifx extension for interacting with Informix databases
These methods overload the ones declared in DB_common.
More info on Informix errors can be found at: http://www.informix.com/answers/english/ierrors.htm
TODO:
- set needed env Informix vars on connect
- implement native prepare/execute
$connection =
[line 131]
The raw database connection created by PHP
$dbsyntax = 'ifx'
[line 68]
The database syntax variant to be used (db2, access, etc.), if any
$dsn = array()
[line 137]
The DSN information for connecting to a database
$errorcode_map = array(
'-201' => DB_ERROR_SYNTAX,
'-206' => DB_ERROR_NOSUCHTABLE,
'-217' => DB_ERROR_NOSUCHFIELD,
'-236' => DB_ERROR_VALUE_COUNT_ON_ROW,
'-239' => DB_ERROR_CONSTRAINT,
'-253' => DB_ERROR_SYNTAX,
'-268' => DB_ERROR_CONSTRAINT,
'-292' => DB_ERROR_CONSTRAINT_NOT_NULL,
'-310' => DB_ERROR_ALREADY_EXISTS,
'-316' => DB_ERROR_ALREADY_EXISTS,
'-319' => DB_ERROR_NOT_FOUND,
'-329' => DB_ERROR_NODBSELECTED,
'-346' => DB_ERROR_CONSTRAINT,
'-386' => DB_ERROR_CONSTRAINT_NOT_NULL,
'-391' => DB_ERROR_CONSTRAINT_NOT_NULL,
'-554' => DB_ERROR_SYNTAX,
'-691' => DB_ERROR_CONSTRAINT,
'-692' => DB_ERROR_CONSTRAINT,
'-703' => DB_ERROR_CONSTRAINT_NOT_NULL,
'-1202' => DB_ERROR_DIVZERO,
'-1204' => DB_ERROR_INVALID_DATE,
'-1205' => DB_ERROR_INVALID_DATE,
'-1206' => DB_ERROR_INVALID_DATE,
'-1209' => DB_ERROR_INVALID_DATE,
'-1210' => DB_ERROR_INVALID_DATE,
'-1212' => DB_ERROR_INVALID_DATE,
'-1213' => DB_ERROR_INVALID_NUMBER,
)
[line 97]
A mapping of native error codes to DB error codes
$features = array(
'limit' => 'emulate',
'new_link' => false,
'numrows' => 'emulate',
'pconnect' => true,
'prepare' => false,
'ssl' => false,
'transactions' => true,
)
[line 83]
The capabilities of this DB implementation
The 'new_link' element contains the PHP version that first provided new_link support for this DBMS. Contains false if it's unsupported.
Meaning of the 'limit' element:
- 'emulate' = emulate with fetch row by number
- 'alter' = alter the query
- false = skip rows
$phptype = 'ifx'
[line 62]
The DB driver type (mysql, oci8, odbc, etc.)
__construct (Constructor) [line 174]
This constructor calls
parent::__construct()
Overrides
DB_common::__construct() (This constructor calls
$this->PEAR('DB_Error'))
affectedRows [line 312]
Determines the number of rows affected by a data maniuplation query
- is returned for queries that don't manipulate data.
- Return: the number of rows. A DB_Error object on failure.
Overrides
DB_common::affectedRows() (Determines the number of rows affected by a data maniuplation query)
autoCommit [line 439]
int autoCommit(
[bool
$onoff = true])
Enables or disables automatic commits
- Return: DB_OK on success. A DB_Error object if the driver doesn't support auto-committing transactions.
Overrides
DB_common::autoCommit() (Enables or disables automatic commits)
Parameters:
bool
$onoff
—
true turns it on, false turns it off
commit [line 455]
Commits the current transaction
- Return: DB_OK on success. A DB_Error object on failure.
Overrides
DB_common::commit() (Commits the current transaction)
connect [line 192]
int connect(
array
$dsn, [bool
$persistent = false])
Connect to the database server, log in and open the database
Don't call this method directly. Use DB::connect() instead.
- Return: DB_OK on success. A DB_Error object on failure.
Parameters:
array
$dsn
—
the data source name
bool
$persistent
—
should the connection be persistent?
disconnect [line 227]
Disconnects from the database server
- Return: TRUE on success, FALSE on failure
errorCode [line 537]
int errorCode(
string
$nativecode)
Maps 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.
Overrides
DB_common::errorCode() (Maps native error codes to DB's portable ones)
Parameters:
string
$nativecode
—
error code returned by the database
errorNative [line 519]
Gets the DBMS' native error code and message produced by the last query
- Return: the DBMS' error code and message
Overrides
DB_common::errorNative() (Gets the DBMS' native error code produced by the last query)
fetchInto [line 344]
mixed fetchInto(
resource
$result,
&$arr, int
$fetchmode, [int
$rownum = null], array
$arr)
Places a row from the result set into the given array
Formating of the array and the data therein are configurable. See DB_result::fetchInto() for more information.
This method is not meant to be called directly. Use DB_result::fetchInto() instead. It can't be declared "protected" because DB_result is a separate object.
- Return: DB_OK on success, NULL when the end of a result set is reached or on failure
- See: DB_result::fetchInto()
Parameters:
resource
$result
—
the query result resource
array
$arr
—
the referenced array to put the data in
int
$fetchmode
—
how the resulting array should be indexed
int
$rownum
—
the row number to fetch (0 = first row)
&$arr
—
freeResult [line 423]
bool freeResult(
resource
$result)
Deletes the result set and frees the memory occupied by the result set
This method is not meant to be called directly. Use DB_result::free() instead. It can't be declared "protected" because DB_result is a separate object.
Parameters:
resource
$result
—
PHP's query result resource
getSpecialQuery [line 662]
string getSpecialQuery(
string
$type)
Obtains the query string needed for listing a given type of objects
- Return: the SQL query string or null if the driver doesn't support the object type requested
- See: DB_common::getListOf()
- Access: protected
Overrides
DB_common::getSpecialQuery() (Obtains the query string needed for listing a given type of objects)
Parameters:
string
$type
—
the kind of objects you want to retrieve
ifxRaiseError [line 502]
object the ifxRaiseError(
[int
$errno = null])
Produces a DB_Error object regarding the current problem
Parameters:
int
$errno
—
if the error is being manually raised pass a DB_ERROR* constant here. If this isn't passed the error information gathered from the DBMS.
nextResult [line 297]
true nextResult(
a
$result)
Move the internal ifx result pointer to the next available result
- Return: if a result is available otherwise return false
- Access: public
Parameters:
a
$result
—
valid fbsql result resource
numCols [line 399]
int numCols(
resource
$result)
Gets the number of columns in a result set
This method is not meant to be called directly. Use DB_result::numCols() instead. It can't be declared "protected" because DB_result is a separate object.
Parameters:
resource
$result
—
PHP's query result resource
rollback [line 475]
Reverts the current transaction
- Return: DB_OK on success. A DB_Error object on failure.
Overrides
DB_common::rollback() (Reverts the current transaction)
simpleQuery [line 246]
mixed simpleQuery(
string
$query)
Sends a query to the database server
- Return: + a PHP result resrouce for successful SELECT queries
- the DB_OK constant for other successful queries
- a DB_Error object on failure
Parameters:
string
$query
—
the SQL query string
tableInfo [line 573]
array tableInfo(
object|string
$result, [int
$mode = null])
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. A DB_Error object on failure.
- See: DB_common::tableInfo()
- Since: Method available since Release 1.6.0
Overrides
DB_common::tableInfo() (Returns information about a table or a result set)
Parameters:
object|string
$result
—
DB_result object from a query or a string containing the name of a table. While this also accepts a query result resource identifier, this behavior is deprecated.
int
$mode
—
a valid tableInfo mode