I am using Zend framework. In this i create a model
and put my database connection in this model.
Here is my code so far :-
public function getTagusers(){
try {
$stat = $this->db->query("select a.tagCode child, b.tagCode parent " .
"from tag a, tag b where a.tagParentId=b.tagId");
$aResultData = $stat->fetchall();
}
catch(Exception $e){
error_log('Exception in '.__FUNCTION__.' : line '.__LINE__.' : '
. $e->getMessage());
}
return $aResultData;
}
Now I am using action in controller. My code is so far :-
public function listAction()
{
$tagusers =new Admin_Model_DbTable_Tagusers();
$this->view->taguser =$tagusers->fetchall();
}
Now finally i want to echo my data in view list.html
. My code is so far :-
<script>
<!-- Begin
function Check(chk)
{
if(document.myform.Check_ctr.checked==true){
for (i = 0; i < chk.length; i++)
chk[i].checked = true ;
} else {
for (i = 0; i < chk.length; i++)
chk[i].checked = false ;
}
}
// End -->
</script>
<?php foreach($this->taguser as $taguser) ?>
<form name="myform" action="checkboxes.asp" method="post">
<b>Select Allowed keywords below:</b><br>
<input type="checkbox" name="Check_ctr" value="yes"
onClick="Check(document.myform.check_list)"><b>Select all keywords</b>
<br>
<input type="checkbox" name="check_list" value="1">
<?php echo $this->escape($taguser->tagCode);?><br>
<input type="checkbox" name="check_list" value="2">
<?php echo $this->escape($taguser->tagParentId);?><br>
</form>
But I am not able to echo the data properly. Can anyone explain me what I can do to echo the result according to my query.