Passing NULL values into mysql Stored procedure
<p>I am trying to pass a few NULL values to a stroed procedure but PHP always retains the varaibles to be empty strings '' and not NULL.</p>

<p>My DB insert function looks like this. (I am using a Framework and ADODB so if it looks weird thats why).</p>

<pre><code>function insert_emp($f_name, $last_name, $dob) {

   if(!isset($dob)){
      $dob = NULL;
   }

   $this-&gt;DB-&gt;setConnection("CALL insert_emp('$f_name', '$l_name', '$dob')");
}
</code></pre>

<p>I have ensured that $dob is being passed an empty string ''. But for some reason when it calls the stored proc it is not changed to NULL. dob is a datetime field and mysql complains that you can not enter an empty string as a DATETIME. If I hard code the insert such as this</p>

<pre><code> $this-&gt;DB-&gt;setConnection("CALL insert_emp('Test1', 'Test2', 'NULL')"); 
</code></pre>

<p>it will work. Thanks for the help.</p>
