Now I am writing code that uses if-else statements and even though I've checked syntax correctly, it says:Parse error: syntax error, unexpected T_ELSE in /home/a7347456/public_html/structure/achievements.php on line 77
(77 is almost the last line, BTW)
So, I've seen this before and I make sure that all if's and else's are closed and all that, and it still doesn't work!
So here is the code in question:
PHP Code:
$achieve4 = $_POST['HomeCoinLocator'];
$achieve5 = $_POST['5'];
if ($achieve4 == 'Yes')
{
$astrSQL = "SELECT * FROM Awards_Inv WHERE Username = '$username'";
$rs3 = mysql_query($astrSQL, $connection);
while($row3 = mysql_fetch_array($rs3)){
$soar4 = $row3["Home Coin Locator"];
if ($soar4 == "Yes")
{
$soa4 = "Yes";
$endtext = "You have completed this achievement already.";
}
else
{
$soa4 = "No";
$endtext = "Rewards:<br>+120 Coins<br>+10 Skill Points<br>+1 Award";
$awardSTRsql = "UPDATE Awards_Inv SET `Home Coin Locator` = 'Yes' WHERE Username = '$username'";
mysql_query($awardSTRsql, $connection);
$updatestats1STRsql = "UPDATE User_Info SET Coins = Coins + 120 WHERE Username = '$username'";
$updatestats2STRsql = "UPDATE User_Info SET `Skill Points` = `Skill Points` + 10 WHERE Username = '$username'";
$updatestats3STRsql = "UPDATE User_Info SET Awards = Awards + 1 WHERE Username = '$username'";
mysql_query($updatestats1STRsql, $connection);
mysql_query($updatestats2STRsql, $connection);
mysql_query($updatestats3STRsql, $connection);
}
}
[B]else
{
}[/B]
The bolded area is the part that I tried to remove, but then it says that it needs something to end at the last line...