TubeNations

Member
Sep 8, 2015
6
0
1
United Kingdom
cPanel Access Level
Website Owner
Twitter
Hi all, i just wanted to ask a question, is it possible to have multiple open databases in mysql in php code snippets?

I did searches on google and a lot of the results found was answers on a well known code help site and none really answer it properly, i wondered if it was at all possible to enable multiple database connections at server/root access level on a server?

Thanks kindly
 

TubeNations

Member
Sep 8, 2015
6
0
1
United Kingdom
cPanel Access Level
Website Owner
Twitter
Well what i meant was, well code that can be used that has 2 open databases at the same time.

So for example

$mysqli = new mysqli("localhost","database","password");
$mysqli2 = new mysqli("localhost","database2","password2");

and then we can have code that gets data from each and still have them both open until they are both closed at the end of the php code snippet.
 

TubeNations

Member
Sep 8, 2015
6
0
1
United Kingdom
cPanel Access Level
Website Owner
Twitter
Well basically i am trying to make an admin panel, that shows user data from 2 different databases, 1 being a phpbb database and the other being from our directory database, there is user data in both, and as it stands we get data from the directory database, but emails are stored in the phpbb database, so i wanted to get and show the email too along side the user name and user id we are fetching from the directory database, if that makes sense.