The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Multiple open databases?

Discussion in 'Database Discussions' started by TubeNations, Sep 8, 2015.

  1. TubeNations

    TubeNations Member

    Joined:
    Sep 8, 2015
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    What does this mean, exactly?
     
  3. TubeNations

    TubeNations Member

    Joined:
    Sep 8, 2015
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Whats the code snippet doing?
     
  5. TubeNations

    TubeNations Member

    Joined:
    Sep 8, 2015
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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.
     
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Sounds like you want to create a bridge of some sort with a phpbb forum.

    You might do better to ask about this on the phpbb forums.
     
  7. TubeNations

    TubeNations Member

    Joined:
    Sep 8, 2015
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    United Kingdom
    cPanel Access Level:
    Website Owner
    Twitter:
    Ok thanks for the help though :)
     
    #7 TubeNations, Sep 8, 2015
    Last edited: Sep 8, 2015
Loading...

Share This Page