I m trying to filter out the collection by name which can start from a,b,c and d alphabets.
I have tried following codes
1) addFieldToFilter( 'm_name',array('like' => 'a%'), 'm_name',array('like' => 'b%'), 'm_name',array('like' => 'c%') )
2) addFieldToFilter(array( array('m_name','like' => 'a%'), array('m_name','like' => 'b%'), array('m_name','like' => 'c%'), ))
But both of these are displaying the collection of names starting with alphabet 'a' only.(not b,c,and d). Please help me for getting the right collection.
I have also tried this code $collection = Mage::getModel('manufacturers/manufacturers')->getCollection() ->addStoreFilter(Mage::app()->getStore(true)->getId()) ->addFieldToFilter('m_name',array(array('like'=>'a'.'%')) , array('like'=>'b'.'%'),array('like'=>'c'.'%')) ->addFieldToSelect('*')->load();
But still it is displaying collection of names starting with alphabet 'a' only