I have a script which is intended to display the number of goals a football player has scored during a the season.
The script works great... but I DO NOT WANT the variable displayed on THIS page, instead, I want to reference the variable from another page. Therefore, how do I change this script to NOT display the result?
<?php
$goalresult = mysql_query('SELECT PlayerID, GoalsScored FROM fixtureplayer WHERE (PlayerID = 9) and (GoalsScored <> 0)');
if (mysql_num_rows($goalresult) > 0) {
print '';
$seasongoalsum = array();
while ($myrow = mysql_fetch_array($goalresult)) {
$seasongoalsum[] = $myrow['GoalsScored']; // sum
}
$seasongoalsum = array_sum($seasongoalsum);
?>
<?php echo "$seasongoalsum\n";
} else {
echo "0\n"; } ?>
I tried to remove the...
<?php echo "$seasongoalsum\n";
} else {
echo "0\n"; } ?>
...part of the script, but this causes an error which says..
Parse error: parse error, unexpected $ in d:\phpscript.php
Any idea why this occurs??