YANA 4 PHP Framework
Docs For Class DbServer
Connection to a database server
This class provides methods to establish or test connections with database servers.
Located in /includes/class_dbserver.php
Object | --DbServer
Name | Type | Description |
---|---|---|
$dsn | array | for a description of the $dsn parameter see the text above |
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
}
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
Name | Type | Description |
---|---|---|
$dsn | string | array |
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
Inherited From Object
Documentation generated on Sun, 11 Mar 2007 15:02:27 +0100 by phpDocumentor 1.3.1