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

[eluser]Bigil Michael[/eluser]
i have changed my code
Code:
$build_array = array();
        $fleets = $this->Classifieds_model->select_all_classifieds();
        
        foreach($fleets as $row){
            $build_array[] = array (
                'fleets_array' => $row,
                'listefleets_array' => $this->Classifieds_model->list_all_classifieds($row['id']),
                //'sub_listings_count' => $this->Classifieds_model->count_classifieds($row['id'])
            );
        }
        $meow = $build_array;
        $this->data['meow'] = $meow;
        foreach($meow as $crow)
        {
            foreach ($crow['listefleets_array'] as $lrow)
            {
                echo ' ' .$lrow['id'].'   '. $lrow['heading'].'   ';
                $data['sub_listings_count'] = $this->Classifieds_model->count_classifieds($lrow['id']);
                print_r($data['sub_listings_count']).' <br/>';
            }
        }

now i use echo the values in controller
it is working well. but like this it is not possible to print the values in view page

i tried a lot to write nested foreach
every time i failed..
can any one solve my problem..


Messages In This Thread
problem in listing category and subcategory in the same page - by El Forum - 05-09-2011, 03:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB