In my zend project ,I want to show some health problems along-with a drop-down box and a text-area.My Controller and views are given below.
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>
My problem is 'How to add these data into database?' fields such as problemid and note.Any other alternating way is possible? HeaalthProblems containing in one table and i want to insert each individual person's problems into another table.Please help me..