PHP 4完全中文手册 我形我塑相册 家园常用软件下载 我形我塑相册活动专区 给我留言 我形我塑网站首页
我形我塑,网络相册,www.5x54.com 相册 相册 心情相册,少女相册 免费申请,我形我塑免费相册
 PHP 4 完全中文手册   http://www.5x54.com
 

 


函数:Ora_Bind()


Ora_Bind

链接 PHP 变量到 Oracle 参数。

语法: int ora_bind(int cursor, string PHP variable name, string SQL parameter name, int length, int [type]);

返回值: 整数

函数种类: 数据库功能

内容说明

本函数将 PHP 变量与 SQL 参数系结在一起。SQL 参数 (SQL parameter) 必须是类似 ":name" 的型式。语法中的 type 为可省略的参数选项,可以设成下面三种数字之一:0 为默认值,表输入/输出 (in/out);1 表输入 (in);2 表输出 (out)。在 PHP 3.0.1 版之后,亦可以使用下列常量代替 type 的三种数字值:ORA_BIND_INOUT、ORA_BIND_IN 或 ORA_BIND_OUT。重要的是本函数应是在 ora_parse() 之后与 ora_exec() 之前呼叫使用。若成功则返回 true,反之返回 false。要处理详细的错误信息可使用 ora_error()ora_errorcode()

使用范例

<?php
ora_parse
($curs"declare tmp INTEGER; begin tmp := :in; :out := tmp; :x := 7.77; end;");
ora_bind($curs"result"":x"$len2);
ora_bind($curs"input"":in"51);
ora_bind($curs"output"":out"52);
$input 765;
ora_exec($curs);
echo 
"Result: $result<BR>Out: $output<BR>In: $input";
?>


[ 下一页 ]