title: how to send checkbox value 1 or 0 in database?
body: <pre><code>&lt;input type="checkbox" name="chkbx" value="true" checked&gt;
  
  $data['active'] = $this-&gt;input-&gt;post('active');
  
          if($data['active'] ==  true){
              echo $data['active'] = 1 ;
          }
          else{
              echo $data['active'] = 0 ;
          }
  </code></pre>
  
  <p>It always put 0 value in database. I can't understand.<br>
  please help me to solve this problem.</p>