在我的zend项目中,我想要展示一些健康问题 - 一个下拉框和一个text-area.My控制器和视图如下。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>
我的问题是“如何将这些数据添加到数据库? “字段,如问题和note.Any其他交替的方式是可能的? HeaalthProblems包含在一个表中,我想将每个人的问题插入到另一个表中。请帮助我..