airvan00
08-30-2004, 02:29 PM
I'm very new to PHP and mySql and I'm having problems connecting to mySql (as the topic would suggest :rolleyes: ). I think my problem is just syntax, but I would appreciate any help I can get that will get my project rolling and I hope there isn't a problem with me posting actually users and passwords for my mysql database that I created just for connecting purposes.
Ok, I created the database in DirectAdmin using the MySQL Management link and this is what I successfully created and updated the password to something very simple:
Details
User username_admin has been updated. Use the following values:
Database: username_request
Host: localhost
Username: username_admin
Password: password
So now, I created a "test.php" page to try and connect to it with the following PHP codes:
<?php
// mysql Database info
$host="localhost";
$user="username_admin";
$password="test";
$connection = mysql_connect($host,$user,$password);
?>
Then, I go and try to load my page at http://xxx.xxx.xxx.xxx/test.php and I get the following connect error:
Warning: mysql_connect(): Access denied for user: 'username_admin@localhost' (Using password: YES) in /home/ampacm00/xxx.xxx.xxx.xxx/public_html/test.php on line 8
Is there something wrong with my syntax or is my "mysql_userid" and "password" just incorrect?
Please help, thanks in advance.
Ok, I created the database in DirectAdmin using the MySQL Management link and this is what I successfully created and updated the password to something very simple:
Details
User username_admin has been updated. Use the following values:
Database: username_request
Host: localhost
Username: username_admin
Password: password
So now, I created a "test.php" page to try and connect to it with the following PHP codes:
<?php
// mysql Database info
$host="localhost";
$user="username_admin";
$password="test";
$connection = mysql_connect($host,$user,$password);
?>
Then, I go and try to load my page at http://xxx.xxx.xxx.xxx/test.php and I get the following connect error:
Warning: mysql_connect(): Access denied for user: 'username_admin@localhost' (Using password: YES) in /home/ampacm00/xxx.xxx.xxx.xxx/public_html/test.php on line 8
Is there something wrong with my syntax or is my "mysql_userid" and "password" just incorrect?
Please help, thanks in advance.