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!


Discussion in 'General Discussion' started by mywheels, Dec 26, 2009.

  1. mywheels

    mywheels Registered

    Dec 26, 2009
    Likes Received:
    Trophy Points:

    I am quiet new to Cpanel and webhosting. I have came across several question, from which many of them occurred since i dont have much experience.

    So my problem is that, on localhost i have created a database with some applications, and its working nicely, however, when i upload it to the server, i cant use it, and i cant connect to my database what i have made.


    $connection = mysql_connect("localhost","black","white");
    mysql_select_db("colors", $connection);


    this is nicely working on localhost, but not on the server, how should i modify the coding that will work online? I think i need to write something instead of localhost, but i dont know what it should be.

    If you could tell me the formula, that would help me a lot...

    thank you

  2. thewebhostingdi

    thewebhostingdi Well-Known Member

    Jan 10, 2008
    Likes Received:
    Trophy Points:
    First of all you will have to create the database from your cPanel and then need to create the database user to gain access to the particular database and then try to connect your database. If you still fail then try to use the IP address of your MySQL server replace to localhost and have a try.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

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