View Full Version : MySQL connection trouble...

10-22-2007, 12:25 AM
Ok... so I've looked at the tutorial at php-mysql-tutorials.com and I got the code that looked like this:


$dbhost = 'localhost';

$dbuser = 'username';

$dbpass = 'password';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');

$dbname = 'username_database';



One problem... I've tried this and I got a bunch of error messages like this:
I have replaced the inital values *I just won't give them unless you guys give the ok...*

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'username_admin'@'' (using password: YES) in D:\hshome\markmonz\pureadd.com\construction\connect.php on line 11
Error connecting to mysql

I don't know how to get it so I can just connect and insert data... I haven't tried the insertion code yet because I have a feeling that If I can't connect I can't insert...
I have already done localhost and a number of things... I am using the hosting service www.Gisol.com *I CAN'T SWITCH!* If someone could tell me what how to find the information... the knowledge base at Gisol doesn't tell about MySQL connections very well...

Thanks to anyone who helps with this!

10-22-2007, 07:25 AM
You need to ask your host for the username/password/database.

10-22-2007, 11:48 PM
K thanks I got it working now! WOOT I'M PYCHED! I ALWAYS WANTED TO MAKE A USER DATABASE! Just for fun lol... just for kicks, ok, maybe you all think I'm pycho now or crazy, maybe, just a complete nerd... ha ha... whatever...