I have a non Eav Table and I want to update an attribute in a row where param1=a and param2=b. In sql terms : update mytable column=ab where column1=a and column2=b; I have tried this way:
$mymodel=Mage::getModel(test/test)->getCollection() ->addAttributeToFilter('column1',array('eq'=>'a') ->addAttributeToFilter('column2',array('eq'=>'b'); $var=(int)$mymodel->getData('column'); $var=+1;
Uptil here i am able to get my desired column and make change here
but by using this i am unable to save the value back in db. Can anyone point me where I am doing wrong?What are the alternative ways to execute this query?
EDIT: Another problem I am facing is in my getData line it's showing me the value 1 instead of value 5 which is stored in my DB.