Did you set debug to 2 ? belongsTo relation is generating a JOIN
statement I believe..
I admit I have never tried having this kind of relation over 2
different DB, very interesting case. Did you try to set the Document
with a "not default" config and the user with the default one ?

On Nov 4, 10:12 pm, Martin Wood-Mitrovski
<[EMAIL PROTECTED]> wrote:
> I have a similar question to this one :
>
> http://groups.google.com/group/cake-php/browse_thread/thread/739fceb7...
>
> which is kind of lurking unanswered. :)
>
> Say I have 2 models, User and Document
>
> User hasMany Documents
> Document belongsTo User
>
> They each live in seperate databases, so in the User model i have
>
> var $useDbConfig = 'users';
>
> while the Document uses the default dbConfig.
>
> Both db config's have persistent set to false.
>
> What I would like to do is to query the Document model using conditions on the
> User model, e.g.
>
> $this->Document->recursive = 1;
> $this->Document->findAll(array('User.id'=>'1'));
>
> but I get the error: Unknown column 'User.id' in 'where clause'
>
> which is because the User lives in the other DB.
>
> So, is this supposed to work? or is it a situation i have to deal with 
> manually?
>
> i.e. query one model, loop over the results to provide conditions for querying
> the second model
>
> or is there some other kind of cake magic I can use?
>
> thanks,
>
> Martin


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to