Testing PHP-MySQL connection

Edit

dbHost = IP address of the remote database server.
dbname= give the database name
dbuser= database user
dbPass= the password of the user.

Access this script via browser and check whether the user is able to connect.

$dbHost = " ";
$dbName = " ";
$dbUser = " ";
$dbPass =
$dbType = "mysql";
mysql_connect($dbHost, $dbUser, $dbPass) or die("could not connect ".mysql_error());
mysql_select_db($dbName) or die("could not select db ".mysql_error());
echo "db selected";
?>


Enjoy:)

    0 comments: