Support Joomla!

references:joomla.framework:database:jdatabase-getinstance

getInstance

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Database Class JDatabase Method getInstance Reference getInstance() Never Work in Progress

Returns a reference to the global Database object, only creating it if it doesn’t already exist.

Syntax

JDatabase &getInstance ( $option )

$option array contains the parameters to be passed to the database driver. The database driver is specified by the $option[’driver’] parameter and if omitted defaults to ‘mysql’.

To connect to the Joomla! database you should not call this method directly. Instead use the JFactory class as follows:

Getting a reference to the Joomla! database object

<?php
$db = & JFactory::getDBO();
?>

Discussion

Full name:
E-Mail:
 
references/joomla.framework/database/jdatabase-getinstance.txt (1446 views) · Last modified: 2007/09/15 07:17 by chrisdavenport