Select data in Yii Framework (Very Usefull)

This is very usefull code for new user’s who use yii framework.

Formula 1:

Select data from  table with condition, it is very easy :

  1. $command = Yii::app()->db->createCommand();
  2. $chkSaleOrderProduct = $command->select(‘column_name’)->from(table_name)->where(“column_name=value”)->queryAll();

After running this code you can get result in

  1. echo $chkSaleOrderProduct[0][column_name];

I think this code helps you.


Rajib Kumar Rakhmit

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>