Won't connect to the database

Posted by user1657958 on Stack Overflow See other posts from Stack Overflow or by user1657958
Published on 2012-11-04T16:55:00Z Indexed on 2012/11/04 16:59 UTC
Read the original article Hit count: 97

Filed under:
|
|

I'm confused...I'm using the same code in a different document and in there it's not a problem to get a connection to the database.

But in the new document it's just not working...(password, username, database name...all is checked and correct) :-/

<?php

define ("DB_HOST", "db1234567.db.hello.com"); // set database host
define ("DB_USER", "db1234567"); // set database user
define ("DB_PASS","password123"); // set database password
define ("DB_NAME","db1234567"); // set database name

$link = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die("Couldn't make connection.");
$db = mysql_select_db(DB_NAME, $link) or die("Couldn't select database");

?>

In the browser I get this: "Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'db1234567'@'123.123.12.12 (using password: YES) in /homepages/12/1234567/test/test.php on line 8 Couldn't make connection."

Would be cool if someone could help me :) I'm not seeing any error...

Thx!

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql