参数(私人字符串):oci_connect()将不会使用对象的属性作为参数
$this->username = 'app';
$this->password = 'passwd';
$this->service = '//local/DEV';
不起作用:
$conn = oci_connect($this->username,$this->password,$this->service);
是否工作:
$conn = oci_connect('app','passwd','//local/DEV');
为什么没有oci_connect像对象属性作为参数?使用对象属性时出现无效登录错误,但在使用字符串时成功。所有这些代码都在对象的__construct()中。
修正了错字,存在同样的问题。 – Chad 2013-03-21 18:32:46
好的,你需要更多的细节,比如在'$ this-> username','$ this-> password'和$ $ this-> service'上使用'var_dump'来确保它们真的是你认为他们是。 – andyhassall 2013-03-21 18:39:13
已经做到了。他们都是字符串。 – Chad 2013-03-21 18:41:59