<?PHP
$server = "localhost"; 
$username = "root";
$password = "benk";
$database = "cma_intel";
$mytable  = "tlagendaintel";

if ($database == ""){
	$query = "cma_intel";
	if (mysql_query($query) == null){	
		$query = "CREATE DATABASE cma_intel";
		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_intel";
		$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");
}
?>