title: Insert a PHP false into mysql
body: <p>My MySQL table contains a tinyint(1) value that i use to store a true or false value.</p>
  
  <p>I have the following PHP variables:</p>
  
  <pre><code>$name = '';
  $description = '';
  $active = true;
  </code></pre>
  
  <p>Now my SQL query is as follows:</p>
  
  <pre><code>$query = "INSERT into my_table (my_name, my_description, active) VALUES ('$name', '$description', $active) ";
  </code></pre>
  
  <p>This will only work if my value for $active is true. As soon as the active variable is false, php will insert an empty string, instead of a 0 and thus the query will fail.</p>
  
  <p>What is the best method to use false in such a query?</p>
  
  <p>Should i manually convert the false to a '0' string?
  Is it better use stings on the PHP side right away? in other words declare: $active = '1';
  or can i somehow get PHP to always convert false to a '0' string?</p>
  
  <p>Thanks
  Michael</p>