JDatabase/ construct
From Joomla! Documentation
< API15:JDatabase
The "API15" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
Description[edit]
Database object constructor
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax[edit]
__construct($options)
Parameter Name | Default Value | Description |
---|---|---|
$options | List of options used to configure the connection |
Defined in[edit]
libraries/joomla/database/database.php
Importing[edit]
jimport( 'joomla.database.database' );
Source Body[edit]
function __construct( $options )
{
$prefix = array_key_exists('prefix', $options) ? $options['prefix'] : 'jos_';
// Determine utf-8 support
$this->_utf = $this->hasUTF();
//Set charactersets (needed for MySQL 4.1.2+)
if ($this->_utf){
$this->setUTF();
}
$this->_table_prefix = $prefix;
$this->_ticker = 0;
$this->_errorNum = 0;
$this->_log = array();
$this->_quoted = array();
$this->_hasQuoted = false;
// Register faked "destructor" in PHP4 to close all connections we might have made
if (version_compare(PHP_VERSION, '5') == -1) {
register_shutdown_function(array(&$this, '__destruct'));
}
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples[edit]
Code Examples[edit]