title: Problem in storing value in database (cakePHP)
body: <p>I have a checkbox named required,where if the checkbox is clicked its value is 1,otherwise its 0.
  The value is correctly passed form the view file to the controller. The model file gets the value from the controller, but the value is not being saved.</p>
  
  <p>I echoed the required value in the model,to check if the value is received. The value is echoed as 1. But in the database,it is not updated.</p>
  
  <p>This is my code:</p>
  
  <pre><code>function updateFieldEntries($data)
  {
      $this-&gt;data['Attribute']['id']=$this-&gt;Attribute-&gt;find('all', array(
                                      'fields' =&gt; array('Attribute.id'),
                                      'order' =&gt; 'Attribute.id DESC' ));
  
      $this-&gt;data['Attribute']['id']=$this-&gt;data['Attribute']['id'][0]['Attribute']['id'];
  
      $this-&gt;data['Attribute']['form_id'] = $this-&gt;find('all', array(
                                      'fields' =&gt; array('Form.id'),
                                      'order' =&gt; 'Form.id DESC'));
      $this-&gt;data['Attribute']['form_id']=$this-&gt;data['Attribute']['form_id'][0]['Form']['id'];
  
      $this-&gt;data['Attribute']['instructions']=$data['Attribute']['instructions'];
  
      $this-&gt;data['Attribute']['required']=$data['Attribute']['required'];
      echo " required model ".$this-&gt;data['Attribute']['required'];
  
  
      $this-&gt;data['Attribute']['sequence_no'] =$this-&gt;Attribute-&gt;find('all', array(
                                  'conditions' =&gt; array('Attribute.form_id' =&gt;$this-&gt;data['Attribute']['form_id']),
                                      'fields' =&gt; array('Attribute.sequence_no'),
                                      'order' =&gt; 'Attribute.sequence_no DESC'));
      $this-&gt;data['Attribute']['sequence_no']=$this-&gt;data['Attribute']['sequence_no'][0]['Attribute']['sequence_no'];
  
      if($data['Attribute']['name']== ''){
          $this-&gt;data['Attribute']['label']=$this-&gt;Attribute-&gt;find('all', array(
                                  'conditions' =&gt; array('Attribute.id' =&gt;$this-&gt;data['Attribute']['id']),
                                      'fields' =&gt; array('Attribute.label')                                                                            ));
          $this-&gt;data['Attribute']['label']=$this-&gt;data['Attribute']['label'][0]['Attribute']['label'];
      }
      else{
          $this-&gt;data['Attribute']['label']= $data['Attribute']['name'];
      }
  
      if($data['Attribute']['size']== ''){
          $this-&gt;data['Attribute']['size']=$this-&gt;Attribute-&gt;find('all', array(
                                  'conditions' =&gt; array('Attribute.id' =&gt;$this-&gt;data['Attribute']['id']),
                                      'fields' =&gt; array('Attribute.size')                                                                         ));
          $this-&gt;data['Attribute']['size']=$this-&gt;data['Attribute']['size'][0]['Attribute']['size'];
      }
      else{
          $this-&gt;data['Attribute']['size']= $data['Attribute']['size'];
      }
  
  
     if($data['Attribute']['instructions']== ''){
             $this-&gt;data['Attribute']['instructions']=$this-&gt;Attribute-&gt;find('all', array(
                                  'conditions' =&gt; array('Attribute.id' =&gt;$this-&gt;data['Attribute']['id']),
                                      'fields' =&gt; array('Attribute.instructions')                                                                         ));
      $this-&gt;data['Attribute']['instructions']=$this-&gt;data['Attribute']['instructions'][0]['Attribute']['instructions'];
  
              }
  
      $this-&gt;Attribute-&gt;save($this-&gt;data); 
  
  }
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>I also checked if the required value alone is being saved using saveField option.</p>
  
  <pre><code>$this-&gt;Attribute-&gt;saveField('required',$this-&gt;data['Attribute']['required']);
  </code></pre>
  
  <p>The value 1 got stored in a separate row in the table for that particular attribute. So what is the problem, why is it not getting saved along with the other values.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>If I save an integer value directly,like</p>
  
  <pre><code>       $this-&gt;data['Attribute']['required']='7'; 
  </code></pre>
  
  <p>it gets stored in the database. How?? What is the problem then??</p>