[ Index ]
 

Code source de PHP PEAR 1.4.5

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

title

Body

[fermer]

/DB/ -> dbase.php (sommaire)

The PEAR DB driver for PHP's dbase extension for interacting with dBase databases PHP versions 4 and 5

Author: Tomas V.V. Cox <cox@idecnet.com>
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: dbase.php,v 1.42 2007/01/11 07:43:09 aharvey Exp $
Poids: 510 lignes (15 kb)
Inclus ou requis:0 fois
Référencé: 3 fois
Nécessite: 1 fichier
 DB/common.php

Définit 1 class

DB_dbase:: (10 méthodes):
  DB_dbase()
  connect()
  disconnect()
  query()
  fetchInto()
  freeResult()
  numCols()
  numRows()
  quoteBoolean()
  tableInfo()


Classe: DB_dbase  - X-Ref

The methods PEAR DB uses to interact with PHP's dbase extension
for interacting with dBase databases

These methods overload the ones declared in DB_common.

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

return: void

connect($dsn, $persistent = false)   X-Ref
Connect to the database and create it if it doesn't exist

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

PEAR DB's dbase driver supports the following extra DSN options:
+ mode    An integer specifying the read/write mode to use
(0 = read only, 1 = write only, 2 = read/write).
Available since PEAR DB 1.7.0.
+ fields  An array of arrays that PHP's dbase_create() function needs
to create a new database.  This information is used if the
dBase file specified in the "database" segment of the DSN
does not exist.  For more info, see the PHP manual's
{@link http://php.net/dbase_create dbase_create()} page.
Available since PEAR DB 1.7.0.

Example of how to connect and establish a new dBase file if necessary:
<code>
require_once 'DB.php';

$dsn = array(
'phptype'  => 'dbase',
'database' => '/path/and/name/of/dbase/file',
'mode'     => 2,
'fields'   => array(
array('a', 'N', 5, 0),
array('b', 'C', 40),
array('c', 'C', 255),
array('d', 'C', 20),
),
);
$options = array(
'debug'       => 2,
'portability' => DB_PORTABILITY_ALL,
);

$db =& DB::connect($dsn, $options);
if (PEAR::isError($db)) {
die($db->getMessage());
}
</code>

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

query($query = null)   X-Ref
Pas de description

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 a no-op for dbase, as there aren't result resources in
the same sense as most other database backends.

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

numCols($foo)   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.

numRows($foo)   X-Ref
Gets the number of rows in a result set

This method is not meant to be called directly.  Use
DB_result::numRows() 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 rows.  A DB_Error object on failure.

quoteBoolean($boolean)   X-Ref
Formats a boolean value for use within a query in a locale-independent
manner.

param: boolean the boolean value to be quoted.
return: string the quoted string.

tableInfo($result = null, $mode = null)   X-Ref
Returns information about the current database

param: mixed $result  THIS IS UNUSED IN DBASE.  The current database
param: int   $mode    a valid tableInfo mode
return: array  an associative array with the information requested.



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