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 connection
#1
first of all thanks for this great tool, i've been planning to add user functions to my site but it was too much of a hassle, userspice just made it doable in less than a day.
one thing i'm having a problem with rn is connecting to 2 different databases, i've checked the forum and found an old thread for ver4.3 about the same thing, tried that
Quote:$db1 = DB::getDB(['db1name']);

$db2 = DB::getDB(['db2name']);
and this error came up
Quote:SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known
i've read around and i think there's something i'm doing wrong when using the code above.
both databases are on the same server and use same user, so that's probably not the problem.
one thing may be important to point out is that the code completely stops executing after the error, the rest of the page doesn't load.

the page i'm using the code on is the users\account.php page, i'm trying to use an external database (different from the one used by userspice) to get and display data.
  Reply


Messages In This Thread
multiple database connection - by Hade - 04-30-2019, 10:10 PM
RE: multiple database connection - by mudmin - 04-30-2019, 10:12 PM
RE: multiple database connection - by Hade - 04-30-2019, 10:14 PM
RE: multiple database connection - by Hade - 05-01-2019, 04:35 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)