[eluser]Bigil Michael[/eluser]
hi friend i have changed my controller like this
Code:
$build_array = array();
$fleets = $this->Classifieds_model->select_all_classifieds();
foreach($fleets as $row){
$sub = $this->Classifieds_model->list_all_classifieds($row['id']);
$build_array[] = array (
'fleets_array' => $row,
'listefleets_array' => $sub
);
foreach($sub as $subsub)
{
$this->data['k'] = $this->Classifieds_model->count_classifieds($subsub['id']);
}
}
$meow = $build_array;
$this->data['meow'] = $meow;
it is working fine
my view
Code:
<?php foreach($meow as $crow){?>
<?php echo $crow['fleets_array']['heading'];?>
<?php
foreach ($crow['listefleets_array'] as $lrow){?>
<?php echo $lrow['heading'];?> <?php echo $k ?>
<?php } ?>
<?php } ?>
now the problem is that it only prints the last result.
can anyone correct my problem???
thanks in advance......