Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Query with database link server with pdo in php

83bc3443-4cf7-4248-acbc-bfdb91d194feJun 27 2016 — edited Jul 11 2016

I'm facing a problem right now, i explain :

I have my SQL query :

    SELECT COUNT(*) AS nb, TO_CHAR(myDate,'yyyy-mm-dd') AS dateF, T1.IDCar, T2.IDMotor

    FROM TDB2@MYLINKSERVER,T1

    JOIN T2 ON T1.ID = T2.ID

    WHERE TDB2.IDCar = T1.IDCar

Which use a TDB2@MYLINKSERVER , to connect 2 differents databases from Oracle and use a table from and other database.

In fact, when i launch the query in sql developper, my query returns some datas.

So in php, i have

   $sql = $pdo->prepare('myquerybefore')

    $sql->execute(array($annee));

    $res = $sql->fetchAll(PDO::FETCH_ASSOC);

And when i try to vardump my $res, it returns array(0) { }

So i think that PDO don't use the @LINKSERVER to fetch results.

I have to say that my query works on SQL Developper, but didn't in PHP..

Any help would be appreciated

Thanks,

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 8 2016
Added on Jun 27 2016
1 comment
1,521 views