MyBB Community Forums

Full Version: Define new Database connection from Plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
One of my MyBB based sites uses a 2nd database, which until now I add into inc/init.php after each upgrade as $db2, eg:

$db2->connect($config['hostname2'], $config['username2'], $config['password2']);
$db2->select_db($config['database2']);

But I know want to do this from a plugin so I don't have to make the modifications after each upgrade.

Which plugin hook if any could I use to create the database connection so that it would then be persistent across all files as it is when I manually add it into inc/init.php ?

Thanks
As far as i know, you would have to perform core edits. I dont know if the hooks system can handle this Confused