I have recently signed up with a new hosting package. I am trying to create a user site where asigned people can update database information. I am having trouble making my connection to my MySQL database. I have created a MySQL database called eachfrie_Events. At present it simply has 2 tables and 2 Users.
The cpanel file structure is fairly straightforward (image attached) and I have included a new folder call Connections. In this folder is a file called Localhost.php. This is the code in that file:
[/img]
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_localhost = "localhost";
$database_localhost = "eachfrie_Events";
$username_localhost = "eachfrie_bk";
$password_localhost = "**********";
$localhost = mysql_pconnect($hostname_localhost, $username_localhost, $password_localhost) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db("eachfrie_Events");
?>
The call for connection to the database is in page called CurrentEventsProgram.php and the code for the connections is:
<?php
////////////////////////////////////////
/// connect to database
////////////////////////////////////////
/// include file
$host = "localhost";
$database = "eachfrie_Events";
$username = "eachfrie_bk";
$password = "************";
mysql_connect($host, $username, "eachfrie_bk") or die("Could not connect: " . mysql_error());
mysql_select_db("eachfrie_Events");
?>
When I select the page I get this error message:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'eachfrie_bk'@'localhost' (using password: YES) in /home/eachfrie/public_html/CurrentEventsProgram.php on line 14
Could not connect: Access denied for user 'eachfrie_bk'@'localhost' (using password: YES)
I have checked the Username and password and I am obviously doing somethhing stupid but I can't see what. I have given the relevant priviledges to eachfrie_bk as user.
Can anyone help please before I go completely crazy.
:?
I have starred out the actual passwords for security.