PDO Configuration

Status
Not open for further replies.

Hans Montero

New Member
Messages
4
Reaction score
0
Points
1
Hi everyone,

I have just started using x10hosting and I am not sure how to set up a PDO.
Up to now, all of my projects have been locally hosted so I am not sure how to configure this:

PDO('mysql:hostname=;dbname=exampledb', 'username', 'password')

I know what goes in for username, password, and dbname, but not for hostname.

Any help is appreciated.
Thanks
 

Dead-i

x10Hosting Support Ninja
Community Support
Messages
6,084
Reaction score
368
Points
83
Hi,

You can use localhost as the hostname (since your script needs to be on your hosting account). If you haven't already, you can create a MySQL database from cPanel.

Remember that your username and database name are both prefixed with your account username, followed by an underscore.

Thank you,
 
Status
Not open for further replies.
Top