$connection =
[line 97]
The raw database connection created by PHP
$dbsyntax = 'dbase'
[line 61]
The database syntax variant to be used (db2, access, etc.), if any
$dsn = array()
[line 103]
The DSN information for connecting to a database
$errorcode_map = array(
)
[line 90]
A mapping of native error codes to DB error codes
$features = array(
'limit' => false,
'new_link' => false,
'numrows' => true,
'pconnect' => false,
'prepare' => false,
'ssl' => false,
'transactions' => false,
)
[line 76]
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 = 'dbase'
[line 55]
The DB driver type (mysql, oci8, odbc, etc.)
$result = 0
[line 119]
The quantity of results so far
For emulating result resources.
$res_row = array()
[line 110]
A means of emulating result resources
$types = array(
'C' => 'character',
'D' => 'date',
'L' => 'boolean',
'M' => 'memo',
'N' => 'number',
)
[line 130]
Maps dbase data type id's to human readable strings
The human readable values are based on the output of PHP's dbase_get_header_info() function.
- Since: Property available since Release 1.7.0
__construct (Constructor) [line 147]
This constructor calls
parent::__construct()
Overrides
DB_common::__construct() (This constructor calls
$this->PEAR('DB_Error'))
connect [line 202]
int connect(
array
$dsn, [bool
$persistent = false])
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
dbase_create() page.
Available since PEAR DB 1.7.0.
Example of how to connect and establish a new dBase file if necessary:
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,
);
if (PEAR::isError($db)) {
die($db->getMessage());
}
- 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 262]
Disconnects from the database server
- Return: TRUE on success, FALSE on failure
fetchInto [line 303]
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 343]
bool freeResult(
resource
$result)
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.
Parameters:
resource
$result
—
PHP's query result resource
numCols [line 364]
int numCols(
$foo, 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
$foo
—
numRows [line 385]
int numRows(
$foo, resource
$result)
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.
Overrides
DB_common::numRows() (Determines the number of rows in a query result)
Parameters:
resource
$result
—
PHP's query result resource
$foo
—
query [line 272]
void &query(
[
$query = null])
Overrides
DB_common::query() (Sends a query to the database server)
Parameters:
quoteBoolean [line 402]
string quoteBoolean(
boolean
$boolean)
Formats a boolean value for use within a query in a locale-independent manner.
Overrides
DB_common::quoteBoolean() (Formats a boolean value for use within a query in a locale-independent manner.)
Parameters:
boolean
$boolean
—
the boolean value to be quoted.
tableInfo [line 422]
array tableInfo(
[mixed
$result = null], [int
$mode = null])
Returns information about the current database
- Return: an associative array with the information requested. A DB_Error object on failure.
- See: DB_common::tableInfo()
- Since: Method available since Release 1.7.0
Overrides
DB_common::tableInfo() (Returns information about a table or a result set)
Parameters:
mixed
$result
—
THIS IS UNUSED IN DBASE. The current database is examined regardless of what is provided here.
int
$mode
—
a valid tableInfo mode