public function createAction() { if ($this->getRequest()->isPost()) { $polling = $this->getRequest()->getPost('polling'); if ($this->form->isValid($polling)) { if ($polling['status'] == 1) { $this->tbl_polling->update(array("showstatus = 0")); } $polling_id = $this->tbl_polling->insert(array('question' => $polling['question'], 'showstatus' => $polling['showstatus'])); foreach ($polling['answer'] as $key => $answer) { $this->tbl_answer->insert(array('polling_id' => $polling_id, 'answer' => $answer)); } $this->_helper->redirector('index'); } } $this->view->form = $this->form; }