public function save($data) { $ns = new Zend_Session_Namespace('login'); $user_id = $ns->id; $introtext = stripslashes($data['description']); if ($data['key'] == 'add') { $db = Zend_Registry::get('connectDb'); $data1 = array('title' => $data['title'], 'introtext' => $introtext, 'published' => $data['published']); $db->insert('group', $data1); } else { $tbl_section = new Manager_Model_group(); $where = 'id =' . $data['id']; $data1 = array('title' => $data['title'], 'introtext' => $introtext, 'published' => $data['published']); $tbl_section->update($data1, $where); } }