将预言机与 PDO、SID 和INSTANCE_NAME连接起来


Connect oracle with pdo, with SID and INSTANCE_NAME

如何使用PDO::__construct()连接到Oracle。

我拥有的是主机、端口、SID 和INSTANCE_NAME。

寻找我创立的信息

 CONNECT username@[//]host[:port][/service_name][:server][/instance_name]

在 http://docs.oracle.com/cd/E18283_01/network.112/e10836/naming.htm#i498306,但我不知道如何将其"翻译"为 PDO。

试试这个:

oci:dbname=//host:port/SID/INSTANCE_NAME

有关详细信息,请参阅 http://www.php.net/manual/en/ref.pdo-oci.connection.php。用户名单独传递。