1

Connecting to an external database in Joomla 3 is easy following this documentation and works like a charm. But JDatabaseDriver->getInstance method is deprecated in Joomla 4. What is the alternative method to do it in Joomla 4?

1 Answer 1

2

Use Joomla\Database\DatabaseFactory::getDriver():

$db = (new Joomla\Database\DatabaseFactory)->getDriver('mysqli', $options);
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.