$option['driver'] = 'mysql';
$option['host'] = 'host';
$option['user'] = 'MyExternalUserDb';
$option['password'] = 'MyExternalPswDb';
$option['database'] = 'MyExternalDatabase';
$option['prefix'] = '';
$db = &JDatabase::getInstance( $option );
$db->setQuery($query);
$results=$db->loadResultArray();
and work all ok in joomla 2.5.
In Joomla 3.3 I use:
$option['driver'] = 'mysql';
$option['host'] = 'host';
$option['user'] = 'MyExternalUserDb';
$option['password'] = 'MyExternalPswDb';
$option['database'] = 'MyExternalDatabase';
$option['prefix'] = '';
$db = JDatabaseDriver::getInstance( $option ); // changed in joomla 3.3
$db->setQuery($query);
$results=$db->loadResultArray();
but does not work, I do not get any error, but doing a print_r($db) after JDatabaseDriver::getInstance I can see that the object is not initialized properly, you have any suggestions on how to successfully connect to an external database in joomla 3.3? Very thanks
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
To post to this group, send an email to joomla-de...@googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
To post to this group, send email to joomla-de...@googlegroups.com.
Hi Marcello$db->loadResultArray(); doesn't work in Joomla 3 anymore. You need to use $db->loadColumn(); instead. Maybe that's the reason of the error ?