session_register() should not be used its deprecated and on its way out the door ..
instead just set your sessions use the $_SESSION array
CODE
$_SESSION['username'] = "myusername";
$_SESSION['password'] = "mypassword"; // this should be avoided the only reason to deal with a password is for comparison not storage
Some hosts actually have a dedicated mysql database server reason for the odd address mine is on the same box so "localhost" works just fine ...
i did test mine from my local machine and i did not have to use http:// to get it to work remotely
code tested ( of course its a mysqli connection not a basic mysql connection):
CODE
// Create the DB connection
// change these values to what you need...
$mysqli = @new mysqli('yourdatabasename.db.sitename.hostservice.com', 'full_db_username', 'db_password', 'full_database_name');
if ($mysqli->connect_error) {
echo "Connect Error (" . $mysqli->connect_errno . ") " . $mysqli->connect_error . ")";
} else {
echo "CONNECTED!!!";
}
If your not seeing this error, per your code "cannot connect" than you SHOULD be connected ... the die statement should take care of at least a crude error checking method BUT i would add mysql_error() because it can display some pretty use information as to WHY your not connected correctly ...
CODE
mysql_connect("$host", "$username", "$password")or die("cannot connect, error: " . mysql_error());
This post has been edited by RPGonzo: 4 Nov, 2009 - 02:14 PM