title: cakephp saving data into database
body: <p>i am new in cake php.I want to insert form data into database.But could not inserted.please help</p>
  
  <p>controller:
  officetypesController.php</p>
  
  <pre><code>&lt;?php
  class OfficetypesController extends AppController {   
  
      public function add() {
          if ($this-&gt;request-&gt;is('post')) {
              $this-&gt;Officetype-&gt;create();
              if ($this-&gt;Officetype-&gt;save($this-&gt;request-&gt;data)) {
                  $this-&gt;Session-&gt;setFlash(__('The data has been saved'));
  
              }
              $this-&gt;Session-&gt;setFlash(
                  __('The data could not be saved. Please, try again.')
              );
          }
      }
  }
  ?&gt;
  </code></pre>
  
  <p>view</p>
  
  <p>add.ctp</p>
  
  <pre><code>&lt;div class="users form"&gt;
  &lt;?php echo $this-&gt;Form-&gt;create('User'); ?&gt;
      &lt;fieldset&gt;
          &lt;legend&gt;&lt;?php echo __('Add User'); ?&gt;&lt;/legend&gt;
          &lt;?php echo $this-&gt;Form-&gt;input('name');
          //echo $this-&gt;Form-&gt;input('password');
          echo $this-&gt;Form-&gt;input('under', array(
              'options' =&gt; array('1' =&gt; 'HO', '2' =&gt; 'RO')
          ));
      ?&gt;
      &lt;/fieldset&gt;
  &lt;?php echo $this-&gt;Form-&gt;end(__('Submit')); ?&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>model</p>
  
  <p>officetype.php</p>
  
  <pre><code>&lt;?php
  class  Officetype extends AppModel {
  
  
  }
  </code></pre>
  
  <p>database:
  table name :officetypes ,
  fields name :id,name,under</p>
  
  <p>when i click submit button than showing the message "The data could not be saved. Please, try again." </p>