Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Multiple open databases?

Discussion in 'Database Discussion' 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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,570
    Likes Received:
    439
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    What does this mean, exactly?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,570
    Likes Received:
    439
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Whats the code snippet doing?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,570
    Likes Received:
    439
    Trophy Points:
    583
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  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 :)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #7 TubeNations, Sep 8, 2015
    Last edited: Sep 8, 2015
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice