title: How to Insert Values in Database Table in Magento
body: <p>I have created an Admin (Backend) module in Magento where i have created few text fields .. I have created the respective Model for that as well.. When i press my save button it posts the data and I can print_r the value in my Controller. Now I want to store this data into my table.. How can I do it... ?</p>
  
  <p>I am writing the code something like this (Controller):-</p>
  
  <pre><code>public function postAction()
  {
  
          $postData = $this-&gt;getRequest()-&gt;getPost();
          //print_r($postData);exit;
          $model = Mage::getModel('cod/cod');
          //print_r($model);exit;
          $model-&gt;setCodId($this-&gt;getRequest()-&gt;getParam('cod_id'))
              -&gt;setAmount($postData['amount'])
              -&gt;setStatus($postData['status'])
              -&gt;save();
          Mage::getSingleton('adminhtml/session')-&gt;addSuccess(Mage::helper('adminhtml')-&gt;__('Rule was successfully saved'));
  
          $this-&gt;_redirect('*/*/index');'
  }
  </code></pre>
  
  <p>Can Anyone help me with this and I would Like to know what i need to write in my model file..</p>