title: PDO prepared statement - what are colons in parameter names used for?
body: <p>I've seen many articles using colons (<code>:</code>) in front of named parameters when using PDO, and a couple that do not use the colon. I'd just as soon not use the colon, simply because it's one less keystroke and slightly easier to read.</p>
  
  <p>It seems to be working fine for me, but I'm curious if there is something important that I'm missing when it comes to the use of colons?</p>
  
  <p>For example, this works just fine:</p>
  
  <pre><code>function insertRecord ($conn, $column1, $comumn2) {
      try {
          $insertRecord = $conn-&gt;prepare('INSERT INTO Table1 (column1, column2)
          VALUES(:column1, :column2)');
          $insertRecord-&gt;execute(array(
                  'column1' =&gt; $column1,
                  'column2' =&gt; $column2
              ));
      }
      catch(PDOException $e) {
          echo $e-&gt;getMessage();
      }
  }
  </code></pre>
  
  <p>As opposed to most developers using this, which also works:</p>
  
  <pre><code>function insertRecord ($conn, $column1, $comumn2) {
      try {
          $insertRecord = $conn-&gt;prepare('INSERT INTO Table1 (column1, column2)
          VALUES(:column1, :column2)');
          $insertRecord-&gt;execute(array(
                  ':column1' =&gt; $column1,
                  ':column2' =&gt; $column2
              ));
      }
      catch(PDOException $e) {
          echo $e-&gt;getMessage();
      }
  }
  </code></pre>
  
  <p>Notice the colons in the <code>execute</code> statement parameters.</p>
  
  <p>I'd like to understand what the colons are for.</p>