You need to manually put the Alias in there so it knows which order to use.
 So if you're ordering by batch you'd want it to be Batch.code

On Thu, Nov 12, 2009 at 1:43 AM, Ernesto <e.fanz...@gmail.com> wrote:

> Hello.
>
> i have 3 models
>
> - Item
> - Batch
> - Person
>
> Item belongsTo Batch
> Item belongsTo Person
>
> both Item and Batch models have
> var $order = "code"
>
> i'm retrieving data from ItemsController using containable
> $this->Item->find("all", array("contain" => array("Batch",
> "Person")));
>
> i'm getting a "SQL Error 1052: Column 'code' in order clause is
> ambiguous"
>
> is that because containable doesn't put aliases after "ORDER BY"
> clause?
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-...@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com<cake-php%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/cake-php?hl=.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-...@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=.


Reply via email to