views:

38

answers:

2

Hi I can't seem to select data from multiple tables with kohana orm.

When I do:

$obj = orm::factory('a') ->join('b') ->on('a.b_id','=','b.id') ->select ('b.','a.') ->find_all();

The only variables available in $obj are from table a. Can someone help?

A: 

You better ask in kohana forum http://forum.kohanaframework.org/

I guess you have problem in our ORM classes

Yasen Zhelev
A: 

You can't overwrite table a variables with table b ones as you're instancing the Model_A, not Model_B ( ORM::factory('a') ).

When you do this, orm will automatically append select($this->_table_name.*) after all other selects so the previous ones (their keys) will be overwritten.

Kemo