<html>
<head> <title>MySQL Connection Test</title> </head>
<body>
<h2>
<?php
$connection = mysql_connect("localhost","username","password")
or die("Sorry - unable to connect to MySQL");
echo ("Congratulations - you connected to MySQL");
?>
</h2>
</body>
</html>
I'm trying to connect to my website's MySQL database, but I'm not sure how to.. I was following a example in one of my PHP Tutorial Books, but I'm not sure what to put for my Localhost. I have a website, hellsbellboy.com and it has 2 MySQL databases, has Apache and all that.. but I'm not sure what I'm suppose to put in place for Localhost.. I thought it was suppose to be www.hellsbellboy.com, then my username and password but that doesn't work.
this is the error i get when i try and check it:
Warning: mysql_connect(): Access denied for user: 'hellsbel_@localhost' (Using password: YES) in /home/hellsbel/public_html/mysqltest.php on line 6
I cannot connect to the database because: Access denied for user: 'hellsbel_@localhost' (Using password: YES)
http://www.hellsbell...m/mysqltest.php
Thank you for any help.
This post has been edited by Hellsbellboy: 10 December 2004 - 11:01 PM

New Topic/Question
Reply




MultiQuote




|