Dobý deň, prosím Vás kde mám chybu dostávam hlásenie:Parse error: syntax error, unexpected 'catch' (T_CATCH)
function opendatabase(){
$db =mysqli_connect(MYSQLHOST,MYSQLUSER,MYSQLPASS) or die(mysql_error());
try {
if (!$db){
$exceptionstring = "Error connecting to database: <br />";
$exceptionstring .= mysql_errno() . ": " . mysql_error();
throw new exception ($exceptionstring);
} else {
mysql_select_db("test",$db) or die(mysql_error());
return $db;
} catch (Exception $e) {
echo $e->getmessage();
die();
}
}