Re: Using multiple databases with Cake

2007-03-16 Thread nateklaiber
Nate, Thanks for the code sample. I am glad I was wrong in this instance, this proves to be very helpful. I apologize for not trying the earlier example - not sure why I bypassed it last time I read this thread. Peace, Nate On Mar 16, 12:46 pm, "nate" <[EMAIL PROTECTED]> wrote: > Actually, if y

Re: Using multiple databases with Cake

2007-03-16 Thread nate
Actually, if you looked, you'd see that Ryan Rose already posted a code sample, which, on review, seems to be perfectly valid and accurate. On Mar 16, 12:43 pm, "nate" <[EMAIL PROTECTED]> wrote: > (these code samples demonstrate the *correct* way to do it, and are > 1.1 and 1.2 compatible): > > /

Re: Using multiple databases with Cake

2007-03-16 Thread nate
(these code samples demonstrate the *correct* way to do it, and are 1.1 and 1.2 compatible): // database.php: var $default = array( 'driver'=> 'mysql', 'persistent'=> false, 'connect'

Re: Using multiple databases with Cake

2007-03-16 Thread rtconner
I second nateklaiber. I would like to see some code examples also. The only way I've managed to do what you describe is to use getDataSource() and do it manually. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake

Re: Using multiple databases with Cake

2007-03-16 Thread nateklaiber
Grant, I would be interested in finding out how you accomplish this (not to hijack the topic)? Any code examples? I don't doubt you are right - I just haven't found a solution that would let me manage the application between 2 databases. For instance, in a recent application (that already had dat

Re: Using multiple databases with Cake

2007-03-16 Thread nate
Grant, this is a bug in the PHP/MySQL interface, but you only have to use different login credentials if you're using persistent connections. You can set 'persistent' => false in both connections to circumvent this. On Mar 15, 6:58 pm, "Grant Cox" <[EMAIL PROTECTED]> wrote: > Just to clarify, wh

Re: Using multiple databases with Cake

2007-03-15 Thread [EMAIL PROTECTED]
Thanks for the replies, I will put the theory into practice. Regards Guy On Mar 15, 10:58 pm, "Grant Cox" <[EMAIL PROTECTED]> wrote: > Just to clarify, what nateklaiber says is incorrect - you can > definitely have multiple databases used in the same application, all > used in the same action.

Re: Using multiple databases with Cake

2007-03-15 Thread Grant Cox
Just to clarify, what nateklaiber says is incorrect - you can definitely have multiple databases used in the same application, all used in the same action. The only issue I have found with it is that you need to provide a different MySQL username / password for the second connection in your app/c

Re: Using multiple databases with Cake

2007-03-15 Thread RRose
It's possible if you set 'persistent' => false in your database.php config file and use $useDbConfig in your models. Example config/database.php: $dbOne = array ( 'driver'=> 'mysql', 'connect' => 'mysql_connect', 'host' => 'localhost', 'login'=> 'root'

Re: Using multiple databases with Cake

2007-03-15 Thread nateklaiber
If you are looking to actually use both databases, I don't think this is possible with cake. The options others are giving you are to switch between development/production/etc databases. Are you looking to use 2 together throughout the application, or just switch between two? I had an issue where

Re: Using multiple databases with Cake

2007-03-15 Thread rtconner
Yes it is, within each Model just specify $useDbConfig = 'dbconfig' or you can just specify it in AppModel to apply a db config for all models. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To po

Re: Using multiple databases with Cake

2007-03-15 Thread John David Anderson
On Mar 15, 2007, at 11:48 AM, [EMAIL PROTECTED] wrote: > > Hi, > > I was wondering if it would be possible to use two databases in cake. > Some models would access tables in one database and other models would > access tables in another database. Check out $useDbConfig in the models. -- John

Using multiple databases with Cake

2007-03-15 Thread [EMAIL PROTECTED]
Hi, I was wondering if it would be possible to use two databases in cake. Some models would access tables in one database and other models would access tables in another database. Thanks Guy --~--~-~--~~~---~--~~ You received this message because you are subscr