Home >Backend Development >PHP Tutorial > 用plsql可以连接oracle但是用OCILogon连接不下oracle

用plsql可以连接oracle但是用OCILogon连接不下oracle

WBOY
WBOYOriginal
2016-06-13 13:13:29939browse

用plsql可以连接oracle但是用OCILogon连接不上oracle
我以前连接的时候用这段程序可以连接,但是现在连接不上了,一直不知道是什么原因.望大神赐教,源码如下.只修改了正确的IP地址,因为涉及到数据库安全,请各位帮我看看是这段代码有错吗?
代码:
$dbconn=OCILogon("zdext","zd#0228ea2l","(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=*******)(PORT = 1521))(CONNECT_DATA =(SID=ORCL)))") or die('连接数据库失败');

总是连接数据库失败,但是我用plsql去连接的时候就成功了,费解!

------解决方案--------------------
print_r(oci_error());
为什么总是喜好自己处理错误!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn