<?php
	header("Content-Type: application/json");
	$mPong = array();
	$a = &$mPong;
	
	$a["isValid"] = false;
	
	$mHost = $_POST["sqlHost"];
	$mUser = $_POST["sqlUser"];
	$mPass = $_POST["sqlPass"];
	$mData = $_POST["sqlData"];
	
	$mConnection = mysql_connect($mHost, $mUser, $mPass);
	
	if(!$mConnection)
		$a["isValid"] = false;
	else {
		$mDatabase = mysql_select_db($mData);
		if(!$mDatabase)
			$a["isValid"] = false;
		else
			$a["isValid"] = true;
	}
	
	echo json_encode($mPong);
?>