From Joomla! Documentation
Revision as of 03:47, 8 July 2013 by Wilsonge
Returns a reference to the global database object, only creating it if it doesn't already exist. The object returned will be of type JDatabase.
object JDatabase getDBO()
In this example, the Joomla database prefix is retrieved.
$db =& JFactory::getDBO(); echo "Database prefix is : " . $db->getPrefix();
which should output something like this:
Database prefix is : jos_