> The point of having two different configurations is that the models
> using the default configuration won't be affected by the reconnect call
> below. Is that correct?

Yeah, I sort of assumed you had two different sets of models.  One
general, and one user-specific.

> This should be placed in a controller, right? Can this be executed even
> if the current model doesn't and shouldn't use the $user configuration
> and the custom prefix?

Yes, it should be in the controller, and yes, it can be executed even
if the current model doesn't use it, since the model's $useDbConfig
will be set to the default database, and therefore unaffected.

> Now let me explain my current problem:
> Let's say that i, for example, have two user-specific tables, with the
> prefix "prefix_", called "prefix_table1" and "prefix_table2". When
> doing like you said, Cake tells me that the tables "table1" and
> "table2" (without the prefixes) are missing and have to be created.

Okay, you have one of two options here.  You can either set $uses =
null in your controller, and instantiate your models manually *after*
you do the reconnect; or, you can setup an extra copy of all your
tables with no prefixes.

> I tried to create those tables just to see if that could make it work,
> but then the tables without prefixes are used, instead of the ones with
> prefixes.

Right, that'll happen.  You have to call reconnect *before* actually
using the user-specific models.

> Then i removed those again and tried to add this in every model using
> user-specific tables:
> var $useTable = false;
> I did this to stop cake from reading tables until i did the reconnect,
> but that only gave me a bunch of notices, warnings and errors.

Yeah, you don't want to do that.  Personally, I'd just create the
default (empty) tables, and reconnect before using the model.


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

Reply via email to