PHP Parse error: syntax error, unexpected '{' on line ...

[php]
$con = mysql_connect($mysql_host,$mysql_user,$mysql_password);
if (!$con)
{
die('Could not connect: ’ . mysql_error());
}

mysql_select_db($mysql_database, $con);

$result = mysql_query(“SELECT * FROM news ORDER BY date DESC LIMIT 3”);

while($row = mysql_fetch_array($result))
{
echo $row[‘title’] . " " . $row[‘author’];
echo “
”;
}

mysql_close($con);
[/php]
Can anyone tell me as to why it returns a parse error?

The code you posted is fine… but somewhere else you’re either missing a “)” or a “;” or you have an unexpected “{”.

Look through your conditional statements leading up to where the error is thrown…

Sponsor our Newsletter | Privacy Policy | Terms of Service