[ Index ]
 

Code source de PHP PEAR 1.4.5

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/DB/ -> ibase.php (sommaire)

The PEAR DB driver for PHP's interbase extension for interacting with Interbase and Firebird databases While this class works with PHP 4, PHP's InterBase extension is unstable in PHP 4.  Use PHP 5.

Author: Sterling Hughes <sterling@php.net>
Author: Daniel Convissor <danielc@php.net>
Copyright: 1997-2005 The PHP Group
License: http://www.php.net/license/3_0.txt PHP License 3.0
Version: CVS: $Id: ibase.php,v 1.113 2007/01/12 03:11:17 aharvey Exp $
Poids: 1082 lignes (34 kb)
Inclus ou requis:0 fois
Référencé: 3 fois
Nécessite: 1 fichier
 DB/common.php

Définit 1 class

DB_ibase:: (27 méthodes):
  DB_ibase()
  connect()
  disconnect()
  simpleQuery()
  modifyLimitQuery()
  nextResult()
  fetchInto()
  freeResult()
  freeQuery()
  affectedRows()
  numCols()
  prepare()
  execute()
  freePrepared()
  autoCommit()
  commit()
  rollback()
  transactionInit()
  nextId()
  createSequence()
  dropSequence()
  _ibaseFieldFlags()
  ibaseRaiseError()
  errorNative()
  errorCode()
  tableInfo()
  getSpecialQuery()


Classe: DB_ibase  - X-Ref

The methods PEAR DB uses to interact with PHP's interbase extension
for interacting with Interbase and Firebird databases

These methods overload the ones declared in DB_common.

While this class works with PHP 4, PHP's InterBase extension is
unstable in PHP 4.  Use PHP 5.

NOTICE:  limitQuery() only works for Firebird.

DB_ibase()   X-Ref
This constructor calls <kbd>$this->DB_common()</kbd>

return: void

connect($dsn, $persistent = false)   X-Ref
Connect to the database server, log in and open the database

Don't call this method directly.  Use DB::connect() instead.

PEAR DB's ibase driver supports the following extra DSN options:
+ buffers    The number of database buffers to allocate for the
server-side cache.
+ charset    The default character set for a database.
+ dialect    The default SQL dialect for any statement
executed within a connection.  Defaults to the
highest one supported by client libraries.
Functional only with InterBase 6 and up.
+ role       Functional only with InterBase 5 and up.

param: array $dsn         the data source name
param: bool  $persistent  should the connection be persistent?
return: int  DB_OK on success. A DB_Error object on failure.

disconnect()   X-Ref
Disconnects from the database server

return: bool  TRUE on success, FALSE on failure

simpleQuery($query)   X-Ref
Sends a query to the database server

param: string  the SQL query string
return: mixed  + a PHP result resrouce for successful SELECT queries

modifyLimitQuery($query, $from, $count, $params = array()   X-Ref
Adds LIMIT clauses to a query string according to current DBMS standards

Only works with Firebird.

param: string $query   the query to modify
param: int    $from    the row to start to fetching (0 = the first row)
param: int    $count   the numbers of rows to fetch
param: mixed  $params  array, string or numeric data to be used in
return: string  the query string with LIMIT clauses added

nextResult($result)   X-Ref
Move the internal ibase result pointer to the next available result

param: a valid fbsql result resource
return: true if a result is available otherwise return false

fetchInto($result, &$arr, $fetchmode, $rownum = null)   X-Ref
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.

param: resource $result    the query result resource
param: array    $arr       the referenced array to put the data in
param: int      $fetchmode how the resulting array should be indexed
param: int      $rownum    the row number to fetch (0 = first row)
return: mixed  DB_OK on success, NULL when the end of a result set is

freeResult($result)   X-Ref
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.

param: resource $result  PHP's query result resource
return: bool  TRUE on success, FALSE if $result is invalid

freeQuery($query)   X-Ref
Pas de description

affectedRows()   X-Ref
Determines the number of rows affected by a data maniuplation query

0 is returned for queries that don't manipulate data.

return: int  the number of rows.  A DB_Error object on failure.

numCols($result)   X-Ref
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.

param: resource $result  PHP's query result resource
return: int  the number of columns.  A DB_Error object on failure.

prepare($query)   X-Ref
Prepares a query for multiple execution with execute().

prepare() requires a generic query as string like <code>
INSERT INTO numbers VALUES (?, ?, ?)
</code>.  The <kbd>?</kbd> characters are placeholders.

Three types of placeholders can be used:
+ <kbd>?</kbd>  a quoted scalar value, i.e. strings, integers
+ <kbd>!</kbd>  value is inserted 'as is'
+ <kbd>&</kbd>  requires a file name.  The file's contents get
inserted into the query (i.e. saving binary
data in a db)

Use backslashes to escape placeholder characters if you don't want
them to be interpreted as placeholders.  Example: <code>
"UPDATE foo SET col=? WHERE col='over \& under'"
</code>

param: string $query query to be prepared
return: mixed DB statement resource on success. DB_Error on failure.

execute($stmt, $data = array()   X-Ref
Executes a DB statement prepared with prepare().

param: resource  $stmt  a DB statement resource returned from prepare()
param: mixed  $data  array, string or numeric data to be used in
return: object  a new DB_Result or a DB_Error when fail

freePrepared($stmt, $free_resource = true)   X-Ref
Frees the internal resources associated with a prepared query

param: resource $stmt           the prepared statement's PHP resource
param: bool     $free_resource  should the PHP resource be freed too?
return: bool  TRUE on success, FALSE if $result is invalid

autoCommit($onoff = false)   X-Ref
Enables or disables automatic commits

param: bool $onoff  true turns it on, false turns it off
return: int  DB_OK on success.  A DB_Error object if the driver

commit()   X-Ref
Commits the current transaction

return: int  DB_OK on success.  A DB_Error object on failure.

rollback()   X-Ref
Reverts the current transaction

return: int  DB_OK on success.  A DB_Error object on failure.

transactionInit($trans_args = 0)   X-Ref
Pas de description

nextId($seq_name, $ondemand = true)   X-Ref
Returns the next free id in a sequence

param: string  $seq_name  name of the sequence
param: boolean $ondemand  when true, the seqence is automatically
return: int  the next id number in the sequence.

createSequence($seq_name)   X-Ref
Creates a new sequence

param: string $seq_name  name of the new sequence
return: int  DB_OK on success.  A DB_Error object on failure.

dropSequence($seq_name)   X-Ref
Deletes a sequence

param: string $seq_name  name of the sequence to be deleted
return: int  DB_OK on success.  A DB_Error object on failure.

_ibaseFieldFlags($field_name, $table_name)   X-Ref
Get the column's flags

Supports "primary_key", "unique_key", "not_null", "default",
"computed" and "blob".

param: string $field_name  the name of the field
param: string $table_name  the name of the table
return: string  the flags

ibaseRaiseError($errno = null)   X-Ref
Produces a DB_Error object regarding the current problem

param: int $errno  if the error is being manually raised pass a
return: object  the DB_Error object

errorNative()   X-Ref
Gets the DBMS' native error code produced by the last query

return: int  the DBMS' error code.  NULL if there is no error code.

errorCode($nativecode = null)   X-Ref
Maps native error codes to DB's portable ones

param: int $nativecode  the error code returned by the DBMS
return: int  the portable DB error code.  Return DB_ERROR if the

tableInfo($result, $mode = null)   X-Ref
Returns information about a table or a result set

NOTE: only supports 'table' and 'flags' if <var>$result</var>
is a table name.

param: object|string  $result  DB_result object from a query or a
param: int            $mode    a valid tableInfo mode
return: array  an associative array with the information requested.

getSpecialQuery($type)   X-Ref
Obtains the query string needed for listing a given type of objects

param: string $type  the kind of objects you want to retrieve
return: string  the SQL query string or null if the driver doesn't



Généré le : Sun Feb 25 14:08:00 2007 par Balluche grâce à PHPXref 0.7