虽然一切正确但PHP语法错误? [关闭]

Im not sure why am I getting this syntax error.

Parse error: syntax error, unexpected '{' in /var/www/test/db.php on line 13

The code seems fine to me... Can anyone give me a few tips? :)

$server = 'host';
$username   = 'username';
$password   = 'password';
$database   = 'database';

if(!mysql_connect($server, $username,  $password))
{
    exit('Error: could not establish database connection');
}

if(!mysql_select_db($database)
{
    exit('Error: could not select the database');
}

Is missing a close parenthesis

if(!mysql_select_db($database) )
                               ^---Missing
{
exit('Error: could not select the database');
}

You missed a closing ) in your second if statement:

if(!mysql_select_db($database) <<<<<
if(!mysql_select_db($database))

you missed a )

You are missing a ) (closing bracket) in this line:

if(!mysql_select_db($database))

You have missed a closing bracket in your second if statement.

You're missing a parenthesis:

if(!mysql_select_db($database))

In case no one else told you. You missed a ) on the second if statement. That is a ")" or otherwise known as a closing parentheses.