Hey all.
The issue i'm having, is that every time I try to connect to my MySQL database I get a permission error.
My code is:
Code wrote:
<?php
$clientTBname="ClientTable";
$userTBname="UserTable";
$scheduleTBname="ScheduleTable";
$hostname="localhost";
$dbname="dbname";
$username="dbadmin";
$password="dbpassword";
$connection="";
echo "Connecting to database...<br>";
$connection=mysql_connect($localhost, $username, $password);
if (!($connection) || ($connection == '')) {
echo "Failed to connect to database.";
exit();
} else {
echo "Success!<br><br>";
}
Every time I run this, I get this error:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'dbadmin'@'localhost' (using password: YES) in /home/dsp54/public_html/CreateTables.php on line 28
I've tried changing 'localhost' to the server name & MySQL port, but I get the same error.
Anybody encountered anything like this before?
I'm using the same code as I have on a server I worked with a DB on years ago, and it worked back then... so im guessing the issue is with the DB server/host.. but can't seem to figure it out.
Thanks!