oci_bind_by_name:PHP致命错误:只能通过引用传递变量
我试图从Oracle软件包调用函数,但遇到以下错误: PHP致命错误:只能通过引用传递变量 这是我的代码:oci_bind_by_name:PHP致命错误:只能通过引用传递变量,php,oracle11g,iis-7.5,oracle-call-interface,Php,Oracle11g,Iis 7.5,Oracle Call Interface,我试图从Oracle软件包调用函数,但遇到以下错误: PHP致命错误:只能通过引用传递变量 这是我的代码: $connection = $this->getConnection(); if (!$connection){ return null; } $s = oci_parse($connection, "begin my_package.my_function( :param1 ); end;"
$connection = $this->getConnection();
if (!$connection){
return null;
}
$s = oci_parse($connection, "begin my_package.my_function(
:param1
); end;");
//getting the error in this following line:
oci_bind_by_name($s, ":param1", "13")
if($result = oci_execute($s)){
....
}
...
我一直在看其他有着同样错误的帖子,但它们似乎都与这个问题无关
我在Windows7机器上使用的是超过IIS7.5的PHP版本5.5.6
这是my Package中函数的定义:
FUNCTION my_function(param1 IN VARCHAR2) RETURN CLOB IS
BEGIN
-- etc...
-- etc...
END;
oci_bind_by_name的第三个参数是通过引用传递的,因此需要先将其存储在变量中:
$param1 = "13";
oci_bind_by_name($s, ":param1", $param1);