Join the Stack Overflow Community
Stack Overflow is a community of 6.5 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

Parse error: syntax error, unexpected 'if' (T_IF) in StatusIG.php on line 25

I really dont see any problem in my code, why this is happening, please help. Im a beginner in PHP

my LINE 25 is >> if($status == 0)


    $accountdb_ip = "ip"; //Accountserver-IP
    $accountdb_login = "acc"; //Accountserver-Loginname
    $accountdb_pw = "psw"; //Accountserver-Passwort
    $db_ip = "ip"; //DB-Server-IP
    $db_login = "acc"; //DB-Server-Loginname
    $db_pw = "psw"; //DB-Server-Passwort

    $con = mysql_connect($db_ip, $db_login, $db_pw);
    $con_account = mysql_connect($accountdb_ip, $accountdb_login, $accountdb_pw);
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }

    $name = mysql_real_escape_string($_GET["name"], $con);

    $result_id = mysql_query("SELECT * FROM player.player WHERE name='".$name."' LIMIT 1", $con);
    $player_acc_id = mysql_result($result_id, 0, "account_id");

    $result = mysql_query("SELECT * FROM account.account WHERE id='".$player_acc_id."'", $con);
    $status = mysql_result($result, 0, "raiguard")

    if($status == 0)
        {echo "0";}
    elseif($status == 1)
        {echo "1";}
    elseif($status == 2)
        {echo "2";}

    mysql_close($con);
    mysql_close($con_account);

share|improve this question

closed as off-topic by l̅ͯͪ̈̎̽̽if̏̇et͑̐̀͂̊̌̚im̔ͯ͊eͬ̐, echo_Me, nKn, Merlevede, Taryn East Mar 6 '14 at 2:47

  • This question does not appear to be about programming within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

5  
This question appears to be off-topic because it is about basic syntax errors. – l̅ͯͪ̈̎̽̽if̏̇et͑̐̀͂̊̌̚im̔ͯ͊eͬ̐ Mar 1 '14 at 18:00

You missed the semicolon on the end of:

$status = mysql_result($result, 0, "raiguard")

Replace it with:

$status = mysql_result($result, 0, "raiguard");
share|improve this answer
    
It would be a lot easier for us if you posted that error here. – Timo Mar 1 '14 at 18:03
    
thanks but now different error Notice: Undefined index: name in RaiGuardStatusIG.php on line 17 Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 4 in RaiGuardStatusIG.php on line 20 Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 5 in RaiGuardStatusIG.php on line 23 line 17: $name = mysql_real_escape_string($_GET["name"], $con); line 20: $player_acc_id = mysql_result($result_id, 0, "account_id"); line 23: $status = mysql_result($result, 0, "raiguard"); – user3368877 Mar 1 '14 at 18:04
    
@user3368877 how is produced your links to get the GET name ? – echo_Me Mar 1 '14 at 18:05
2  
That's a local link. We can't see that. – Nathan Dawson Mar 1 '14 at 18:12
    
You're using name even if it's not set. Check first and default to a blank string. $name = ( isset( $_GET['name'] ) ) ? mysql_real_escape_string($_GET["name"], $con) : ''; – Nathan Dawson Mar 1 '14 at 18:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.