Testing PHP-MySQL connection

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

Add this script to your public_html (ie: name it dbtest.php) for your site and access it via browser and check whether the user is able to connect.

<?php
$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”;
?>

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.