Adrian Voicu
Adrian Voicu
That is because on insert, you won't receive anything from the database than eventually the insert id or maybe the total number of rows inserted.
Let's discuss this in issue #182
Then why not do it like this? $results = $this->role_model->with_persons('order_by:last_name,asc')->order_by('title','asc')->get_all(); :P
@louiswalch could you try now? ```php $results = $this->person_model->with_role('fields:whatever,whatever2,whatever3|join:true')->order_by('roles.title, persons.last_name','asc')->get_all(); ```
It already prepends the field name with relation name and "_"
If you still want to define an AS, when mentioning fields, you must also prepends them with their table name... or wait until I make an update on this.
Are you sure. Will test this.
That is because you didn't mention the fields you want from main table. ```php $results = $this->person_model->fields('field1,field2,field3')->with_role('fields:whatever,whatever2,whatever3|join:true')->order_by('roles.title, persons.last_name','asc')->get_all(); ``` if you don't use fields() in the chain, it will use...
@zilzurna Hush... It's a secret...
@zilzurna (...but, since you asked, it is a join for two tables with a one-to-one relationship... this way, you only do a query and not two...)