<?PHP
$server = "localhost"; 
$username = "root";
$password = "benk";
$database = "cma_pidsus";
if ($database == ""){
	$query = "cma_pidsus";
	if (mysql_query($query) == null){	
		$query = "CREATE DATABASE cma_pidsus";
		mysql_query($query);
		$conn = mysql_connect($server,$username,$password) or die ("Could not connect MySQL"); 
		mysql_select_db($database,$conn) or die ("Could not open database");
	}
	else{
		$database= "cma_pidsus";
		$conn = mysql_connect($server,$username,$password) or die ("Could not connect MySQL"); 
		mysql_select_db($database,$conn) or die ("Could not open database");		
	}	
}
else{
	$conn = mysql_connect($server,$username,$password) or die ("Could not connect MySQL"); 
	mysql_select_db($database,$conn) or die ("Could not open database");
}
?>