Quantcast
Viewing all articles
Browse latest Browse all 2274

Joomla! 5.x Coding • Re: SQL connect to external database -- Illegal offset type

You're supposed to pass the class you need to container's get() method but you're passing database parameters. There is no relevant service in the container that you could use. To create a custom database instance, use Joomla\Database\DatabaseFactory:

Code:

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

Statistics: Posted by SharkyKZ — Tue Feb 13, 2024 6:49 am



Viewing all articles
Browse latest Browse all 2274

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>