Parse error: syntax error, unexpected T_VARIABLE

Discussion in 'PHP' started by AIucard, Apr 6, 2011.

  1. #1
    can someone tell me what's wrong with this? the error is on line 26 but idk what is wrong.

    <?php
    if( !ereg("index.php", $_SERVER['PHP_SELF']) )
    {
    header("Location: index.php");
    die();
    }

    if( isset($_POST['fetchrank']) )
    {
    $query01 = odbc_exec($connection, "
    SELECT CLID FROM {$_CONFIG[ClanTable]}(nolock) WHERE

    DeleteFlag=0 AND ((Wins != 0) OR (Losses != 0))
    ORDER BY Point Desc, Wins Desc, Losses Asc");
    $rank = 0;

    while( odbc_fetch_row($query01) )
    {
    $rank++;
    $clid = odbc_result($query01, 1);
    odbc_exec($connection, "UPDATE {$_CONFIG[ClanTable]} SET Ranking =

    $rank WHERE CLID = $clid");
    }

    }
    {
    if( $clanname == "" || $type == "" || $id == "" )
    {
    ("Create Clan"$_STR[Msg1]);
    die;
    }

    like isaID in my other post im kind of new at this. so if it's something really obvious please dont laugh at me.
     
    AIucard, Apr 6, 2011 IP
  2. scriptsapart

    scriptsapart Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi,

    There is an additional " { " (Open syntax) in the code.
    Run the code after removing it.
     
    scriptsapart, Apr 6, 2011 IP
  3. scriptsapart

    scriptsapart Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Forgot to mention, the open syntax is on line 27.
     
    scriptsapart, Apr 6, 2011 IP
  4. AIucard

    AIucard Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    :[ No luck
     
    AIucard, Apr 6, 2011 IP
  5. AIucard

    AIucard Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    it only gives me another error, only tihs time its on line 25
     
    AIucard, Apr 6, 2011 IP
  6. scriptsapart

    scriptsapart Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hi,

    Try this code. Works for me.

    <?php

    if(!ereg("index.php", $_SERVER['PHP_SELF']) )
    {
    header("Location: index.php");
    die();
    }

    if( isset($_POST['fetchrank']) )
    {
    $query01 = odbc_exec($connection, "
    SELECT CLID FROM {$_CONFIG[ClanTable]}(nolock) WHERE

    DeleteFlag=0 AND ((Wins != 0) OR (Losses != 0))
    ORDER BY Point Desc, Wins Desc, Losses Asc");
    $rank = 0;

    while( odbc_fetch_row($query01) )
    {
    $rank++;
    $clid = odbc_result($query01, 1);
    odbc_exec($connection, "UPDATE {$_CONFIG[ClanTable]} SET Ranking =

    $rank WHERE CLID = $clid");
    }

    }

    if( $clanname == "" || $type == "" || $id == "" )
    {
    die("Create Clan".$_STR['Msg1']);
    }

    ?>
     
    scriptsapart, Apr 6, 2011 IP
  7. AIucard

    AIucard Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Awww, now my clan management is blank.
     
    AIucard, Apr 6, 2011 IP
  8. scriptsapart

    scriptsapart Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Hi,

    I am not sure what you are trying to do with the code. Let me know if I can be of any more help to you.
     
    scriptsapart, Apr 6, 2011 IP
  9. AIucard

    AIucard Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    im making a panel for my gunz
     
    AIucard, Apr 6, 2011 IP