title: PDO bind multiple values in one statement
body: <p>Im working with a lot of sql queries. While I have not mastered PDO yet I was hoping to come here for a bit of help since my previous searches didn't deliver much in terms of help. I did come across <a href="https://stackoverflow.com/questions/1176352/pdo-prepared-inserts-multiple-rows-in-single-query">this link on SO</a> but it seems a bit out of scope to what I am doing</p>
  
  <p>Consider The following code, which works 100%;</p>
  
  <pre><code>public function composeMsg($userID, $toUser, $subject, $msg, $sentOn ){
          $db = DB::getInstance();
          $sql = "INSERT INTO messages (userID, fromID, subject, body, senton) values (:userID, :toUser, :subject, :msg, :sentOn )";
          $stmnt = $db-&gt;prepare($sql);
          //NOT EFFICIENT
          $stmnt-&gt;bindValue(':userID', $userID);
          $stmnt-&gt;bindValue(':toUser', $toUser);
          $stmnt-&gt;bindValue(':subject', $subject);
          $stmnt-&gt;bindValue(':msg', $msg);
          $stmnt-&gt;bindValue(':sentOn', $sentOn);
  
          $stmnt-&gt;execute();
          if($stmnt-&gt;rowCount() &gt; 0){
              return true;
          }
          else{
              return false;
          }
      }//FUNCTION
  </code></pre>
  
  <p>Im finding myself to continuously type <code>$stmnt-&gt;bindValue(':value', $value)</code> multiple times <em>as can be seen from the code above</em>. <strong>Im looking for a build in PDO function or something similar which I can make use of to avoid all the repetition.</strong>  </p>
  
  <p>Any advise welcomed</p>