I am not able to find why my query is not working
$data['active']=1
$bind=$this->_db->quoteInto('id = ?', $id);
$returnval= $this->_db->update($this->_name,$data,$bind);
`UPDATE `discount_rule` SET `isActive` = ? WHERE (rule_id = 20)`
why “?” !. I had tried many way but I am not able to make it in this way.$this_db is type Zend_DB_Adapter_abstract. either it’s silly mistake or I am not able to understand how to use Zend_Db_Table_Abstract – update() !.
More details
class demo_Model_price extends Zend_Db_Table_Abstract{
public function update($data,$id){
$where='id ='.$id; //i changed it to see if this work
try{
$returnval= $this->update($this->_name,$data,$where);
return $returnval;
}catch(Exception $e)
{
echo $e->getMessage();
}
}
}
Can someone identify whats wrong in my query. It’s a simple query and it should work.
Hope you are using
ModelsSome general points
Always start a class in caps
Demo_Model_priceupdateis a function thats a keyword ofzendTry the code below
}