This is what I did inside yii framewok:
public function servicesQuery($section){ $data = Yii::app()->db->createCommand() ->select('*') ->from('services') ->where("section='$section'") ->queryAll(); return $data; }
then inside my view file:
<?php $consultation = $this->servicesQuery("consultation"); ?> ?> <?php foreach($consultation as $consul): ?> <span class="text-1"><?php echo $consul['content']; ?></span> <?php endforeach;?>
What I am doing is capturing the part of the cretin table that I selected. should work only for php minus the path "Yii" for db
Erik Leath Nov 02 '12 at 19:25 2012-11-02 19:25
source share