The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple Database Connections
#4
I'm working on that. Right now, there's a way where you can put the credentials in the init.php, so you can do

$GLOBALS['config'] = array(
'mysql' => array(
'host' => 'localhost',
'username' => 'root',
'password' => '',
'db' => 'oe1',
),
'myotherdb' => array(
'host' => '192.168.25.16',
'username' => 'bob',
'password' => 'bobspw',
'db' => 'oe2',
),

And then do $db2 = getDB(['myotherdb','ns']); //ns means new server
But I haven't written the ability to specify credentials on the fly. I'll work on that.
  Reply


Messages In This Thread
Multiple Database Connections - by usamusa - 09-03-2018, 02:46 PM
RE: Multiple Database Connections - by mudmin - 09-03-2018, 03:12 PM
RE: Multiple Database Connections - by usamusa - 09-03-2018, 03:45 PM
RE: Multiple Database Connections - by mudmin - 09-03-2018, 03:56 PM
RE: Multiple Database Connections - by usamusa - 09-04-2018, 06:12 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)