title: Isn't PHP's null value equal to MySQL's null value?
body: <p>I have a variable on php and it sometimes can be <code>NULL</code> and I want to insert this variable to my db. But problem is, PHP's null value does not insert to db as null value.</p>
  
  <p>My column on db allows null values.</p>
  
  <pre><code>if($variable != true){
     $variable = null;
  }
  
  //insert my null value to db
  
  $insert = $db-&gt;prepare("insert into mytable set mycolumn = $variable" );
  $insert-&gt;execute();
  
  //mycolumn is an integer column which is DEFAULT null
  
  //above query fails. Why?
  </code></pre>