Joomla! makes extensive use of the database and provides some powerful tools for accessing, retrieving, and updating the database. At initialization, Joomla! creates a connection to the database by instantiating a global
JDatabase object. This database connection can be accessed within your extension by assigning an object reference to a local variable using the static
JFactory class method
getDBO(), as is shown in the following:
$db =& JFactory::getDBO();
Note that we must use =& which assigns a reference to the existing database object to the variable; using = will create a copy of the existing database object.
JDatabaseMySQLi, extend the
JDatabase class depending on the exact database ...