show version
4) otherwise tell incorrect db user/pass combination
Freeware for comercial or non-commercial use.
no warranties!
*/
$submit = empty($_REQUEST['submit']) ? 0:1;
if ($submit) {
$db_host = empty($_REQUEST['db_host']) ? "localhost" : $_REQUEST['db_host'];
$db_user = empty($_REQUEST['db_user']) ? "" : $_REQUEST['db_user'];
$db_pass = empty($_REQUEST['db_pass']) ? "" : $_REQUEST['db_pass'];;
if ( empty($db_host)
|| empty($db_host)
|| empty($db_host) ) {
die("Missing fields.");
}
$link = @mysql_connect($db_host, $db_user, $db_pass);
if (!$link)
die("Can't connect.
Please check your data.");
$qry = "SELECT VERSION()";
$result = @mysql_query($qry);
if (!$result) {
die("Query error: " . mysql_error() . "");
}
$ver = @mysql_result($result, 0);
print "MySQL version: $ver";
@mysql_free_result($result);
}
?>