title: Uncaught exception: Invalid parameter number
body: <p>I am firing an update query that works for one page, but not another.</p>
  
  <p>Here's the output:</p>
  
  <pre>
  Fatal error: Uncaught exception 'Doctrine_Connection_Mysql_Exception' with message 
      'SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens' in
      C:\xampp\htdocs\fanyer\doctrine\lib\Doctrine\Connection.php:1084
      Stack trace:
      #0 C:\xampp\htdocs\fanyer\doctrine\lib\Doctrine\Connection\Statement.php(253): 
         Doctrine_Connection-&gt;rethrowException(Object(PDOException),         
         Object(Doctrine_Connection_Statement))
      #1 C:\xampp\htdocs\fanyer\doctrine\lib\Doctrine\Connection.php(1049):      
         Doctrine_Connection_Statement-&gt;execute(Array)
      #2 C:\xampp\htdocs\fanyer\doctrine\lib\Doctrine\Query\Abstract.php(1091):    
         Doctrine_Connection-&gt;exec('UPDATE users SE...', Array)
      #3 C:\xampp\htdocs\fanyer\doctrine\lib\Doctrine\Query\Abstract.php(1142):   
         Doctrine_Query_Abstract-&gt;_execute(Array)
      #4 C:\xampp\htdocs\fanyer\doctrine\models\Users.php(122):
         Doctrine_Query_Abstract->execute()
      #5 C:\xampp\htdocs\fanyer\include\update_profile.inc.php(18):
         Users->update_coach_details('', '', NULL, 'Select', 'dav', 'coach', '3')
      #6 in C:\xampp\htdocs\fanyer\doctrine\lib\Doctrine\Connection.php on line 1084
  </pre>
  
  <p>Here's my code:</p>
  
  <pre><code>public function update_coach_details($fname,$lname,$city,$state,$school,$rights,$user_id)
  {
      return Doctrine_Query::create()
          -&gt;update('Users')   
          -&gt;set('f_name', '?', $fname)
          -&gt;set('l_name', '?', $lname)
          -&gt;set('city', '?', $city)
          -&gt;set('state', '?', $state)
          -&gt;set('school', '?', $school)
          -&gt;set('rights', '?', $rights)
          -&gt;where("id = '$user_id'")
          -&gt;execute();
  }
  
  $account_type=$_SESSION['rights'];
  $fname= $_POST['fname'];
  $lname= $_POST['lname'];
  $state= $_POST['state'];
  $school= $_POST['school'];
  $sports= $_POST['sports'];
  $sports_array = explode(',',$sports);
  $user_id=$_SESSION['user_id'];
  $users= new Users();
  $users-&gt;update_coach_details($fname,$lname,$city,$state,$school,$account_type,$user_id);
  </code></pre>
  
  <p>Is the problem caused by my passed parameters?</p>