I am trying to fetch information from the related table after putting condition in the query, but it doesn’t work. It works correctly if i remove the join statement and don’t ask for data of column in related table
if(isset($_POST['ProductIndex']))
{
$searchresult = Yii::app()->db->createCommand()
->select('p.product_id, p.product_name, r.price, p.master_key') //works fine without r.price
->from('tbl_product_index p')
->join('tbl_pricing r', 'r.product_id=p.product_id') //works fine without this sentence
->where('master_key=:master_key', array(':master_key'=>$_POST['ProductIndex']['brand']['1']))
->queryAll();
$dataProvider=new CArrayDataProvider($searchresult);