title: Insert boolean true / false to Postgres and MySQL
body: <p>i fight with DB, trying to insert true and false values to my table with column boolean, but always getting just error:</p>
  
  <blockquote>
    <p>Invalid parameter number</p>
  </blockquote>
  
  <p>tested with:</p>
  
  <pre><code>$value = true
  $value = "true"
  $value = 1
  </code></pre>
  
  <p>Can somebody please advise me?
  Thanks</p>
  
  <p>EDIT:
  full code would looks like:</p>
  
  <pre><code>// adding value to variabile
                      if (empty($row['vin']))
                          $vin = 0;                   
                      else
                          $vin = 1;
  //calling insert method
  $this-&gt;insertToTable($model_code, $typ, $kind, $ts, $vin,  $smr, $ire, $manufacturer_code);
  
  //full insert method:
      public function insertToTable($code, $name, $kind, $ts, $vin, $smr, $ire, $manufacturer_code)
      {                   
          try {                                       
              $con = new PDO( DB_HOST, DB_USER, DB_PASS );            
              $con-&gt;setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );            
              $sql = "INSERT INTO r_vehicle_model(code, name, kind, ts, vin, smr, ire, manufacturer_code) VALUES(:code, :name, :kind, :ts, :smr, :ire, :manufacturer_code)";
              $stmt = $con-&gt;prepare( $sql );
              $stmt-&gt;bindValue( 'code', $code, PDO::PARAM_STR );                
              $stmt-&gt;bindValue( 'name', $name, PDO::PARAM_STR );                
              $stmt-&gt;bindValue( 'kind', $kind, PDO::PARAM_STR );                
              $stmt-&gt;bindValue( 'ts', $ts, PDO::PARAM_STR );                
              $stmt-&gt;bindValue( 'vin', $vin, PDO::PARAM_STR );                
              $stmt-&gt;bindValue( 'smr', $smr, PDO::PARAM_STR );                
              $stmt-&gt;bindValue( 'ire', $ire, PDO::PARAM_STR );                
              $stmt-&gt;bindValue( 'manufacturer_code', $manufacturer_code, PDO::PARAM_STR );                
              $stmt-&gt;execute();                
              }
          catch( PDOException $e ) {
                  echo $e-&gt;getMessage();
              }           
      }   
  </code></pre>
  
  <p>full error:</p>
  
  <blockquote>
    <p>SQLSTATE[HY093]: Invalid parameter number: :vin</p>
  </blockquote>