Re: Multiple Databases Model Relationship

2012-01-06 Thread robbie
I found my problem. The Employee table didn't have values for the Job table. The error was because the links were absent for certain records. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org a

Re: Multiple databases with different column

2009-06-10 Thread Okto Silaban
Why don't you use MySQL Replication? On Tue, Jun 9, 2009 at 4:26 AM, Henrik Gemal wrote: > > I'm accessing databases stored on difference computers. Everything > works just fine now since all the databases have the same columns on > the different computers. So no problem now. > > But we need to u

Re: Multiple databases with different column

2009-06-09 Thread Dr. Loboto
Model::hasField('mySpecialField') - but you should restrict models cache for your case or this call will check cached schema. On Jun 9, 4:26 am, Henrik Gemal wrote: > I'm accessing databases stored on difference computers. Everything > works just fine now since all the databases have the same co

Re: Multiple Databases and Multiple Cakes

2009-05-13 Thread BaronNowhere
Found 2 links which help described what I think I need. I'm still tinkering, but I thought I'd share the links here in case someone searches for the same question. http://nik.chankov.net/2008/04/10/using-more-than-one-database-connection-in-cakephp/ http://savasplace.com/2009/05/multiple-databa

Re: Multiple databases using same app and cake core

2007-03-14 Thread soytuny
francky06l, Your approach work great! It gets rid of the pesky notices, and it will make it easier to do master reports about all systems. BTW, so I didn't have to change each model, I put the line > var $useDbConfig = CLIENTDB; in app_model.php and that seems to work. Thanks, Russell On

Re: Multiple databases using same app and cake core

2007-03-14 Thread soytuny
Addendum: The last two items cause PHP to give a notice because those constants are defined later on. I had to define the APP_PATH because cake \bootstrap.php and cake\libs\configure.php use it to find core.php and bootstrap.php. This seems to work, and now when I need to fix bugs in my code I

Re: Multiple databases using same app and cake core

2007-03-14 Thread francky06l
you can use the same database.php. In this one you could define different database ie : 'client1', 'client2' etc config ..In your index.php you could define a value set to the spotted DB (ie : define('CLIENTDB', 'client1'); and at the end in your models you could set : var $useDbConfig = CLIENT

Re: Multiple Databases

2006-09-13 Thread Tony
Nate that's pretty interesting. I'm glad to see that there is a way of using multiple databases with an application. When you were talking about this; // Run a query $this->Model->findAll(...); // Switch to a different database connection $this->Model->setDataSource("other_connection"); // Run an

Re: Multiple Databases

2006-09-05 Thread nate
Cake allows you to connect to an unlimited number of databases in a single application session/request. To change the target of one database connection you can do the following: $db = ConnectionManager::getDataSource("default"); // Get a reference to the default database $db->reconnect(array("da

Re: Multiple databases for login - How To?

2006-07-05 Thread gwoo
Well, I thought you were "theman"? Anyway, what you want to do here is definitely possible in Cake. check out the useDbConfig property of the model. You should be able to adjust that in the beforeFilter. you will want an AppController. As far as the default page, that is setup in routes.php which