title: PHP Update form using mysqli
body: <p>I'm new to PHP, I need some help here. I have created a form called <strong>Home.php</strong> which accepts ID,name &amp; file upload as inputs and it adds into mysql. Its adding successfully. I want to perform update operation so that if a user wants to update any of the fields. So what I want is it has to update these 3 fields in db. <strong>But I'm getting a following error in Process.php</strong>.</p>
  
  <p><strong>Error : Warning: mysqli_stmt::bind_param(): Number of variables doesn't match number of parameters in prepared statement</strong></p>
  
  <p>Here's the relevant part of my code:</p>
  
  <pre><code>$sql = "UPDATE info SET id=?, name=?, upload=? WHERE id=?";
  if(!($stmt = $mysqli-&gt;prepare($sql)))
  {
    die("Unable to prepare statement");
  }
  else
  {
    $stmt-&gt;bind_param("iss", $id, $name, $upload);    
    if($stmt-&gt;execute())
    {
      echo "Successfully updated";
    }
    else
    {
      die("Update failed");
    }
  }
  </code></pre>