How do I connect to a MySQL Database with PHP?

  • Answered
I've used PHP with MYSQL previously on inMotion with no troubles. However, with a new account I cannot seem to run a simple PHP script that outputs some sample MySQL data. I am included to think there is something wrong with my account because I followed your example on this page ( ) exactly but it fails on line #16 when setting the connection. I can send you my code if you like. The url where I am simply trying to set up the simple PHP page is here:

Phil Threadgould
Account Name = XXXXXXX
Hello thread7, Thank you for letting us know you were able to get it working. For anyone else who may find this post, here is a link to our guide on How to create a MySQL Database. After it is created, you can create and attach a user to the database in cPanel. Then, you will be able to connect to it using PHP. If you have any further questions, feel free to post them below. Thank you, -John-Paul