samporras Posted January 2, 2010 Posted January 2, 2010 Hi guys. This is a pretty simple question. I'm relatively new to php, and I'm trying to use the php mysql_connect() function to connect to a database I created, but I don't know what to put in for the servername and user. for the server, I wasn't sure if I need put in my domain name, server name (that's indicated in cpanel), or just localhost. I'm assuming that for the username I just put in any of the users I created using the MySQL Database wizard. Thanks in advance. Sam Quote
TCH-Bruce Posted January 2, 2010 Posted January 2, 2010 Hope this helps ><?php // Setup database access $dbhost = "localhost"; $dbuser = "your-domain_your-user"; $dbpass = "database-password"; $dbname = "your-domain_your-filename"; ?> Quote
samporras Posted January 4, 2010 Author Posted January 4, 2010 Thaks Bruce...that definitely helps! Sam Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.