How to display the id value from two tables b / d advert and category. At this time, it displays only the value of $ adver-> id.
public function actionIndex() { $advert = Advert::model()->findAllBySql('SELECT * FROM o_advert'); $this->render('index', array('model' => $advert)); $c = Advert::model()->findAllBySql('SELECT * FROM o_category'); $this->render('index', array('model' => $c)); } <?php foreach (array_reverse($model) as $adver) { ?> <?php echo $adver->id; ?> <?php echo $adver->title; ?> <?php } ?> <?php foreach ($model as $c) { ?> <?php echo $c->id; ?> <?php echo $c->description; ?> <?php } ?>