Multiple Database Connection

Multiple Database Connection

omurltsomurlts Posts: 35Questions: 6Answers: 0

Hello Editor Server side multiple connection and select trying but im have problem.
my config.php configuration :

$oracledb = array(
"type" => "Oracle",
"user" => "user",
"pass" => "pass",
"host" => "host",
"port" => "1521",
"db" => "ORCL",
"dsn" => "charset=utf8mb4",
"pdoAttr" => array()
);

$mysqldb = array(
"type" => "Mysql",
"user" => "user",
"pass" => "pass",
"host" => "host",
"port" => "3306",
"db" => "db",
"dsn" => "charset=utf8mb4",
"pdoAttr" => array()
);

and my bootstrap file configuration :

$dbo = new Database( $oracledb );
$dbm = new Database( $mysqldb );

and im not trying two database select

Editor::inst( $dbm, 'dbm.tablename')
->fields(
Field::inst( 'dbm.tablename.col' ),
Field::inst( 'dbo.tablename.col' )
)
->debug(true)
->process( $_POST )
->json();

where am i making a mistake

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Field::inst( 'dbo.tablename.col' )

    Should that be:

    Field::inst( 'dbm.tablename.col' )
    

    ?

    That said, I'm not actually sure what the issue is other than I guess that it isn't working? Are you getting any error messages? If so, what are they?

    Allan

  • omurltsomurlts Posts: 35Questions: 6Answers: 0

    my question : two database select same query

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    I don't understand that. Do you mean one query involves two databases?

  • omurltsomurlts Posts: 35Questions: 6Answers: 0

    yes tangerine

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    It would be worth replying to Allan's questions above. You didn't address his points.

    Colin

This discussion has been closed.