Hi,
http://groups.google.com/group/cake-php/browse_thread/thread/eacfade1d52c9071/f5e3c395037043b3
read above URL.
Thanks.
On Oct 31, 3:35 pm, Daivat <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have one major problem for that i am not getting the proper
> solution.
>
> I need to use two different tables in a single controller, but both
> tables are from two different databases.
>
> my database.php is as below:
>
> class DATABASE_CONFIG
> {
> var $default = array('driver' => 'mysql',
> 'connect' =>
> 'mysql_connect',
> 'host' =>
> 'localhost',
> 'login' =>
> 'root',
> 'password' =>
> '******',
> 'database' =>
> 'database1',
> 'prefix' =>
> '');
>
> var $test = array('driver' => 'mysql',
> 'connect' =>
> 'mysql_connect',
> 'host' =>
> 'localhost',
> 'login' =>
> 'root',
> 'password' =>
> '******',
> 'database' =>
> 'database2',
> 'prefix' =>
> '');}
>
> ?>
>
> my model class contains code like below:
>
> <?php
> class ModelName2 extends AppModel {
> var $name = 'ModelName2';
> var $useDbConfig = 'test';
> //var $useTable = 'model_names';}
>
> ?>
>
> controller contains:
>
> class MyController extends AppController {
> var $name = 'My';
> var $uses = array('ModelName1','ModelName2');
> ...........
> ...........
> ...........
> ...........
>
> }
>
> But such code give me error like below:
> Fatal error: Cannot redeclare class dbosource in /www/
> *****************/cake/libs/model/datasources/dbo_source.php on line
> 1716
>
> Please help me to fix this problem....
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---