Forum Moderators: open

Message Too Old, No Replies

what have i done wrong.

         

Flolondon

12:37 pm on Mar 17, 2006 (gmt 0)

10+ Year Member



$user= " ";
$host= "localhost";
$password = " ";
$database = "cars";
$connection = mysql_connect ($host, $user, $password)
or die (" could not connect to server");

$db=mysql_select_db ($database, $connection)
or die (" could not connect to database");

?> W

arning: mysql_connect() [function.mysql-connect]: Access denied for user ' '@'localhost' (using password: YES) in - could not connect to database

physics

3:26 pm on Mar 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Looks like you need a username and password for the database "cars". Or if it is wide open then try "" for the username and pass instead of " ".
Do you use the command line at all? If you do, try accessing it from there. Or if you use phpmyadmin you can add a user and pass for the database in there...

ChadSEO

3:27 pm on Mar 17, 2006 (gmt 0)

10+ Year Member



Flolondon,

If there is no password, then remove the space from $password, so:

$password = "";

Otherwise it's trying to pass a space as the password, and probably failing on that.

Chad