# tnsnames.ora Network Configuration File: D:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\tnsnames.ora
# Generated by Oracle configuration tools.
TEST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = leohuang)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = test)
)
)
ASF =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = ASF02)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ASF)
)
)
用下面的话,就可以在php中访问连接了
$conn = oci_connect('asfcms', 'beehive', 'ASF');
if (!$conn) {
$e = oci_error();
print htmlentities($e['message']);
exit;
}