YANA 4 PHP Framework
Docs For Class DbServer
Connection to a database server
Located in /includes/class_dbserver.php
create a new instance
The $dsn parameter became available in version 2.8 It is an array containing the following information (all entries are optional):
string ( DBMS ) default = mysql name of the php-dbms api to be used e.g. mysql, mysqli, db2, ...
string ( HOST ) default = localhost adress of the host e.g. localhost, 123.456.789.0, COMPUTER-NAME\DB-INSTANCE (windows+MS-SQL)
integer ( PORT ) default = 0 port number
string ( USERNAME ) default = root
string ( PASSWORD ) default = n/a
string ( DATABASE ) default = yana name of the database
The default settings may be changed by editing file config/system.config in key DEFAULT.DATABASE.DSN. The parameter $dsn has the following fall-back behaviour: $dsn -> global user settings -> yana default settings
Name | Type | Description |
---|---|---|
$dsn | array | for a description of the $dsn parameter see the text above |
get a PEAR-DB connection object
This function returns an open database connection via PEAR-DB. The returned values are:
null = if PEAR-DB was not found
(boolean) false = if the connection failed
(object) DB_common = if the connection was established successfully
test if a connection is available
returns (boolean) true if a connection to a db-server could be established via the provided parameters. See the constructor method for details on the $dsn parameter
Name | Type | Description |
---|---|---|
$dsn | string | array |
Documentation generated on Sat, 16 Sep 2006 17:05:56 +0200 by phpDocumentor 1.3.0RC4