title: Parse error: syntax error, unexpected ';' in C:\xampp\htdocs\look_api.php on line 3
body: <p>I got a script called look_api.php for a generator.</p>
  
  <p>But when I try it I get this:</p>
  
  <pre><code>Parse error: syntax error, unexpected ';' in C:\xampp\htdocs\look_api.php on line 3
  </code></pre>
  
  <p>The page:</p>
  
  <pre><code>&lt;?php
                      error_reporting(1);
    $user = str_replace("'", "\\\'", str_replace('"', '\\"', $_GET['user']); 
                      if($username = NULL) { $username = "Yvan" };
  
          $con=mysqli_connect("MYSQL_IP","USER","PASSWORD","DATABASE");
          // Mysql Connection
          if (mysqli_connect_errno())
            {
            echo "Ai, check je mysql connection!: " . mysqli_connect_error();
            }
          $result = mysqli_query($con,"SELECT look FROM users WHERE username = '".$username."'");
  
          while($row = mysqli_fetch_array($result))
            {
  
  
          ?&gt;
  </code></pre>
  
  
  
  <pre><code>        &lt;?php
           }
  
          mysqli_close($con);
          ?&gt;
  
      &lt;/div&gt; &lt;/div&gt;
  </code></pre>
  
  <p>When I remove the ; on the line I get this error:</p>
  
  <pre><code>Parse error: syntax error, unexpected T_IF in C:\xampp\htdocs\look_api.php on line 4
  </code></pre>
  
  <p>The code in the script is on that moment:</p>
  
  <pre><code>&lt;?php
                      error_reporting(1);
    $user = str_replace("'", "\\\'", str_replace('"', '\\"', $_GET['user']) 
                      if($username = NULL) { $username = "Yvan" };
  
          $con=mysqli_connect("MYSQL_IP","USER","PASSWORD","DATABASE");
          // Mysql Connection
          if (mysqli_connect_errno())
            {
            echo "Ai, check je mysql connection!: " . mysqli_connect_error();
            }
          $result = mysqli_query($con,"SELECT look FROM users WHERE username = '".$username."'");
  
          while($row = mysqli_fetch_array($result))
            {
  
  
          ?&gt;
  </code></pre>
  
  
  
  <pre><code>        &lt;?php
           }
  
          mysqli_close($con);
          ?&gt;
  
      &lt;/div&gt; &lt;/div&gt;
  </code></pre>
  
  <p>So... How do I fix it?</p>