title: PHP + PDO: Bind null if param is empty
body: <p>I'm trying this (and all PoST var are treated before user send it, no SQL Injection worries):</p>
  
  <pre><code>$stmt = $con-&gt;prepare($sql);
  $stmt-&gt;bindParam(":1", $this-&gt;getPes_cdpessoa());
  $stmt-&gt;bindParam(":2", $this-&gt;getPdf_nupessoa_def());
  </code></pre>
  
  <p>When any of those vars are NULL, PDO cries and don't let execute my statement, and on my Table, i DO allow these fields beign nullables.</p>
  
  <p>Is there any way to check if the values are empty, pdo just bind NULL to then (and i mean, a smart way instead if(empty($_POST['blablabla')...) for every single param?</p>