I am upgrading my components from Joomla 1.7 to Joomla 3.3 and have to keep the original database. Therefore I need to access the display data from another database as the installation database. I tried a method that I used many times before with Joomla 2.5 but it seems that I cannot get it right this time.
In my model in the
getListQuery() method (which overrides the modellist method) I use the following code to access the database from where I want to get my data:
$dbOptions = getDbOptions(); $db = & JDatabase::getInstance($dbOptions);
where the connection details of my old database are contain in
I continue to use the following code:
$query = $db -> getQuery(true); $query -> select('*') -> from('table'); return $query;
I do include the following in the beginning:
modellist extends JModelLegacy, therefore I do believe that it uses the following:
But it gives me an error that the table newDatabase.table does not exits and therefore the method I am using does not connect to my old database to retrieve the data from oldDatabase.table.
I am unsure about the inclusion of
jimport('joomla.application.component.modellist'); though, could be the problem?
Anyone who can help to retrieve the data from my original database?</div