Welcome Guest, Not a member yet? Register   Sign In
problem in listing category and subcategory in the same page
#12

[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......


Messages In This Thread
problem in listing category and subcategory in the same page - by El Forum - 05-09-2011, 11:07 PM



Theme © iAndrew 2016 - Forum software by © MyBB