If the Joomla database is DB1, how can I connect to DB2? Both databases reside on the same server. Normally when I am working with SQL I would just replace the FROM #__content with FROM DB2.table to get data from the table I need.
Below is the standard solution for a Joomla database. How can I convert this to the second database?
$db =& JFactory::getDBO();
$query = "
SELECT `id`, `title`
FROM `#__content`
WHERE `sectionid` = 1
AND `state` = 1 ;
Below is the standard solution for a Joomla database. How can I convert this to the second database?
$db =& JFactory::getDBO();
$query = "
SELECT `id`, `title`
FROM `#__content`
WHERE `sectionid` = 1
AND `state` = 1 ;