title: prepared statements UPDATE
body: <p>I am getting the below error when I try to update the query using mysqli prepared statements. what is wrong with the error message why it is unexpected? any help.</p>
  
  <pre><code>Parse error: syntax error, unexpected '$prob' (T_VARIABLE)
  </code></pre>
  
  <p>Here is the query</p>
  
  <pre><code>$mysqli = new mysqli("localhost", "root", "", "newlogin");
          if ($mysqli-&gt;connect_errno) {
          echo "Failed to connect to MySQL: (" . $mysqli-&gt;connect_errno . ") " . $mysqli-&gt;connect_error;
          }
          $check = $mysqli-&gt;prepare("select * from `vpb_uploads` where `username` = ? and `firstname` = '' and `image_one` != ''");
          $check-&gt;bind_param('s', $username);
          $check-&gt;execute();
          $check-&gt;store_result();
  
          if($check-&gt;num_rows &lt; 1)
          {
              echo '&lt;div class="vpb_error_info" align="left"&gt;Sorry, It seems you have not added any file yet.&lt;br&gt;Please click on the Add Files button to first of all add at least one file before submitting your details. Thanks...&lt;/div&gt;';
          }
          else
          {
          $firstname = trim(strip_tags($_POST["firstname"]));
          $lastname = trim(strip_tags($_POST["lastname"]));
  
          if( $prob = $mysqli-&gt;prepare("update `vpb_uploads` set `firstname` = ?, `lastname` = ? where `username` = ? and `firstname` = '' and `image_one` != ''")
          $prob-&gt;bind_param('sss', $firstname, $lastname, $username);
          $prob-&gt;execute();
          )
  
          {
                  echo '&lt;font style="font-size:0px;"&gt;success&lt;/font&gt;';
                  echo '&lt;div class="vpb_error_info" align="left"&gt;Congrats &lt;b&gt;'.$firstname.' '.$lastname.'&lt;/b&gt;, your details have been submitted successfully. Thanks...&lt;/div&gt;';
          }
  </code></pre>