I’m using kohana 2.x for my project,I’ve following query
$result = ORM::factory('table1')
->join('table2','table1.id','table2.id')
->find_all();
Using above query I can fetch data from table1,but I need fetch data from table2 also.When I’m giving like this
$result->table2_column_name;
It showing error,how can I fetch the data from table2.
Your statement is neither ORM or Active Record. If you have a
Table1_Modelclass that extendsORMclass then you can useORM::factory('table1');You also need almost same thing for table2. And for each class there should be relations declared. Getting Started with ORMThe resultant models will be,
Now you can query like this,