title: Invalid parameter number on PDO Prepared Statement
body: <p>I'm working with a sequence of queries created with PDO class, in some case, my queries needs the same parameter.
  I've created an array used in a foreach statement which save the data but some variables come from outside, can I use both data in one query?</p>
  
  <p>the example:</p>
  
  <pre><code>// $connection is the PDO object;
  // $full_data contains:
  // $full_data[$i]["address"]
  // $full_data[$i]["phone"]
  // $full_data[$i]["email"]
  // $full_data[$i]["user_id"]
  // $full_data[$i]["surname"] // not used but present
  // $full_data[$i]["name"] // not used but present
  
  $sql = "UPDATE users_table SET city = :address, phone = :phone, email = :email, admin_id = :admin_id, admin_name = :admin_name WHERE user_id = :user_id";
  $statement = $connection-&gt;prepare ($sql);
  
  
  $statement-&gt;bindParam (':admin_id', trim($admin_id), PDO::PARAM_INT);
  $statement-&gt;bindParam (':admin_name', trim($admin_name), PDO::PARAM_STR);
  
  
  foreach ($full_data as $value) {
      $ok = $statement-&gt;execute ($value);
      $num = $statement-&gt;rowCount ();
  }
  
  } catch (PDOException $e) {
      return $e-&gt;getMessage ();
  }
  </code></pre>
  
  <p>this page return me the error:
  <code>
  SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens</code></p>
  
  <p>what is exactly the problem, on an UPDATE statement the technique works </p>