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
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
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
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
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
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
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
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
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
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
10 matches
Mail list logo