title: PHP PDO how to update information
body: <p>I am very new to PHP, I am using PHP MVC with PDO.</p>
  
  <p>I'm trying to update the first name and last name of my 'Profile' table for a given user ID.</p>
  
  <p>Here's my <strong>model</strong>:</p>
  
  <pre><code>public function update(){
      $stmt = $this-&gt;_connection-&gt;prepare("UPDATE Profile SET first_name = ?, last_name = ?, WHERE user_id = :user_id");
      $stmt-&gt;bindParam(':user_id', $_SESSION['user_id']);
      $stmt-&gt;execute();
      return $stmt-&gt;rowCount();
  }
  </code></pre>
  
  <p>Here's my <strong>controller</strong>:</p>
  
  <pre><code>        $prof = $this-&gt;model('Profile');
          $myProfile = $prof-&gt;getProfile($_SESSION['username']);
  
          if(isset($_POST['action'])){
                   $myProfile -&gt;first_name = $_POST['First_name'];
                   $myProfile -&gt;last_name = $_POST['Last_name'];
                   $myProfile -&gt;update();
  
          }
  </code></pre>
  
  <p>It does not work, I'm getting the following <strong>error</strong>:</p>
  
  <p><code>PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters (points to excute in model)</code></p>