As a fairly new user to php I thought that the code attached should work. ie; all brackets are balanced. But in firebug-xdebug, it is saying that there is a Parse error: syntax error, unexpected '}'. The line it refers to I have highlighted in my code. What is the cause of this. Thanks
<?php
foreach ($array as $box) {
$box = mysql_real_escape_string($box);
$sql = "SELECT item FROM temp WHERE item = '$box'";
$result = mysql_query($sql) or die ('{"opp":"error","box":"' . mysql_error() . '"}');
if (mysql_num_rows($result) > 0) {
$outString .= $box . ','
}<---THIS LINE ERROR
}
?>