PDA

View Full Version : mysql_connect() issues



phmacomber
03-18-2009, 12:22 PM
I am brand new to Bluehost, so I am trying to figure out some things.

$server = "boxXXX.bluehost.com";
$userName = "tiXXXX_XXXXXXXXXXX";
$password = "XXXXXXXXXXXXXXXXXXXX";
$db = "tiXXXXXXXX_XXXXXXXX";


mysql_connect($server, $userName, $password) or die(mysql_error()) ; I fail here
mysql_select_db($db) or die(mysql_error()) ;


I am not getting connected; am I using the wrong host; is the another prescribed way to access the DB in bluehost?

felgall
03-18-2009, 12:34 PM
The host needs to be localhost

Both database and username have your eight character account name and an underscore as a prefix.

phmacomber
03-18-2009, 01:03 PM
That worked; different hosting services do things differently :)