Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-13-2012, 12:07 PM   PM User | #1
zingzing45
New Coder

 
Join Date: Jun 2012
Posts: 57
Thanks: 13
Thanked 0 Times in 0 Posts
zingzing45 is an unknown quantity at this point
Internet Explorer Tangled if-else

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...
zingzing45 is offline   Reply With Quote
Old 09-13-2012, 12:27 PM   PM User | #2
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,045
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
I see no closing bracket for this "if" statement ...


if ($achieve4 == 'Yes')

{
mlseim is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:06 AM.


Advertisement
Log in to turn off these ads.