Hi everyone, I have 2 tables with HAS_MANY Relationship. table - TopicsExpress



          

Hi everyone, I have 2 tables with HAS_MANY Relationship. table student and table score, which 1 student can have many score. When i want to access to the table data, it get errors: Trying to get property of non-object. This is my code: $data=Student::model()->with(scores)->findAllByPk(2); foreach($data as $info) { echo $info->idstudent. .$info->name; foreach($data->scores as $score) { echo $score->score; } }
Posted on: Thu, 28 Aug 2014 06:47:14 +0000

Trending Topics



Recently Viewed Topics




© 2015