栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > PHP > PHP函数库

PHP - 函数:Ora_Bind()

PHP函数库 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

PHP - 函数:Ora_Bind()

Oracle 数据库函数库
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", $len, 2);
ora_bind($curs, "input", ":in", 5, 1);
ora_bind($curs, "output", ":out", 5, 2);
$input = 765;
ora_exec($curs);
echo "Result: $result BR Out: $output BR In: $input";
?


[ 下一页 ]

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/2041.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号