PDA

View Full Version : MySQL connection trouble...



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

<?php

$dbhost = 'localhost';

$dbuser = 'username';

$dbpass = 'password';



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



$dbname = 'username_database';

mysql_select_db($dbname);

?>

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'@'66.152.166.189' (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!

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

Rockonmetal
10-23-2007, 12:48 AM
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...