Yii Framework Forum: How To Fetch The Data From Another Table Using Cdbcriteria And Cactivedataprovider? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How To Fetch The Data From Another Table Using Cdbcriteria And Cactivedataprovider? Rate Topic: -----

#1 User is offline   rajkumar000000 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 88
  • Joined: 18-September 12

Posted 29 January 2013 - 03:46 AM

Hello friends...
how to fetch the data from another table using CdbCriteria and CActiveDataProvider and this data will be display in view part in CListView?
pls help me.
which is appreciated for me..
thanks in advance..
0

#2 User is offline   mbala 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 102
  • Joined: 21-July 12
  • Location:Chennai, Tamilnadu, India

Posted 29 January 2013 - 03:51 AM

Using relation name You can get the another table values ex. in Listview table2.name, table2.value
--------
Bsourcecode
0

#3 User is offline   rajkumar000000 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 88
  • Joined: 18-September 12

Posted 29 January 2013 - 04:10 AM

View Postmbala, on 29 January 2013 - 03:51 AM, said:

Using relation name You can get the another table values ex. in Listview table2.name, table2.value
--------
Bsourcecode


thanks mbala...

i am using this link....

Quote


My link

this is done properly after that in the view part another table data not come.
pls give me some suggestion..
0

#4 User is offline   rajkumar000000 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 88
  • Joined: 18-September 12

Posted 29 January 2013 - 07:50 AM

i solved this problem......

i am using "with" in CActivedataprovider and CDbCriteria in controller..
$criteria = new CDbCriteria();
$dataProvider = new CActiveDataProvider('ProductIndex', array(
					'criteria' => array(
'with' => 'pricing',
'with' => 'masterKey',));



and in view part i use this..

$data->pricing->price
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users