How do I connect PHP template or program to a database

Asked by:
tspanacea / 5 Points
2012-01-25 2:59 pm EST
Website Troubleshooting
Trying to get a PHP template called ‘Profolio’ installed and working at (add-on domain at

Template designer says to install: “Open up the file config.php and change the Database Host, Username, Password and Name information to your own values.”

I changed them to:
$host = "";
$db_username = "the email address I use to log in to Web Hosting Hub";
$db_password = "the password I use to log in to Web Hosting Hub";
$database = "";

Then uploaded the profolio folder with the new config.php file to public_html/

But when I enter: in browser, the following error is returned:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user ''@'' (using password: YES) in /home/panace7/public_html/ on line 15
Access denied for user ''@'' (using password: YES)

Can you tell me where I’m going wrong? Thanks………..Tom

To ask this user for more information, please first login.

To submit an answer, please login.

Best answer chosen by Web Hosting Hub staff


13,688 Points
2012-01-25 3:38 pm EST
Hello Tom,

I'm sorry you're having trouble connecting your PHP file to your database. When connecting to a database, the user name and password needed will not be the same as your AMP user name and password.

From what I can see (based on reviewing PHP files and online research) this is a stand alone program (as opposed to a theme for another program). Please see our article on Manual Installation of PHP Software for step-by-step instructions on how to connect your new PHP program to a database.

If you have any questions or need further assistance during the installation process, please let us know. We're always happy to help!


Christi N.

To submit a comment on this answer, please first login.

Want to share this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!

Help Center Search

Current Customers

Email: Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.