내 zend 프로젝트에서 드롭 다운 상자 및 텍스트 영역과 함께 몇 가지 건강상의 문제를 보여주고 싶습니다. 내 컨트롤러 및보기는 아래에 나와 있습니다.데이터 제출 zendframework
class IndexController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
$healthproblems =new Model_DbTable_Healthproblems();
$this->view->healthproblems=$healthproblems->fetchAll();
}
public function addAction()
{
}
}
--index.phtml--
<table border='1'>
<tr>
<th>Name</th>
<th> </th>
<th> </th>
</tr>
<?php foreach($this->healthproblems as $prob) : ?>
<tr>
<td><?php echo $this->escape($prob->healthproblem_name);?></td>
<td><select id="ddl_<?php echo $prob->prob_id; ?>">
<option selected="selected">--Select--</option>
<option>Yes</option>
<option>No</option>
</select></td>
<td><input type="text" style="width: 50px" value=""></input></td>
</tr>
<?php endforeach; ?>
<tr><td colspan="3" align="center">
<input type="submit" id="submit" value="Submit" ></input></td></tr>
'어떻게 데이터베이스에이 데이터를 추가하는 것입니다 내 문제? ' problemid 및 메모와 같은 필드가 있습니다. 다른 모든 대체 방법이 가능합니까? HeaalthProblems 하나의 테이블에 포함하고 각 개인의 문제를 다른 테이블에 삽입하고 싶습니다. 제발 도와주세요.