title: Magento - Module INSERT,UPDATE, DELETE, SELECT code
body: <p>I created a module and want to used core write and read function to insert,update,delete or select database value with condition, how can I do it without using SQL?
  Example:
  $customer_id=123
  Model=(referral/referral)</p>
  
  <p>SELECT</p>
  
  <pre><code> $collection3 = Mage::getModel('referral/referral')-&gt;getCollection();
      $collection3-&gt;addFieldToFilter('customer_id', array('eq' =&gt; $customer_id));
      foreach($collection3 as $data1)
      {
      $ref_cust_id.= $data1-&gt;getData('referral_customer_id'); 
      }
  </code></pre>
  
  <p>INSERT</p>
  
  <pre><code>$collection1= Mage::getModel('referral/referral');
  $collection1-&gt;setData('customer_id',$customer_id)-&gt;save();
  </code></pre>
  
  <p>DELETE,UPDATE(with condition)=???</p>