syntax error, unexpected 'something' (T_VARIABLE)
<p>Why I'm getting this error?</p>

<blockquote>
  <blockquote>
    <p>syntax error, unexpected '$flag' (T_VARIABLE)</p>
  </blockquote>
</blockquote>

<pre><code>    while(odbc_fetch_row($result))
    {
        $name = odbc_result($result,"CharName");
        $lvl = odbc_result($result,"CharLevel");
        $class = odbc_result($result,"CharClass");
        $flag = 0;
        for($i=0;$i&lt;count($gms);$i++)
        {
            if($name = $gms[$i]
                $flag = 1;
        }
    }
</code></pre>
