<?php
$HSTNAME = "127.0.0.1";
$USRNAME = "jcmcclurg";
$PSWORD = "";
$DBNAME = "test";
// Attempt to establish a link with an sql database using the credentials
// and database name supplied above. The @ suppresses any errors that
// might appear. We print these errors out later with the mysql_error()
// function call.
$credentialCheck = @mysql_connect($HSTNAME,$USRNAME,$PSWORD);
$dbNameCheck = @mysql_select_db($DBNAME);
if($credentialCheck && $dbNameCheck)
{
}
else
{
echo("Invalid credentials:<br>");
echo(mysql_error());
die;
}
?>