php连接oracle数据库代码(转) Lin 杰
$ora_host = "172.19.*.259"; $ora_port="1521"; $ora_sid = "orasid"; $ora_username = "orauser"; $ora_password = "orapwd"; $charset = "UTF8"; ### zhs16gbk ### $ora_connstr = "(description=(address=(protocol=tcp) (host=".$ora_host.")(port=".$ora_port.")) (connect_data=(service_name=".ora_sid.")))"; $conn = oci_connect($ora_username, $ora_password,$ora_connstr); if (!$conn) { $e = oci_error(); trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR,$charset); } $stid = oci_parse($co