位置: 编程技术 - 正文

PHP:oci_fetch()的用法_Oracle函数(php oci)

编辑:rootadmin
oci_fetch

推荐整理分享PHP:oci_fetch()的用法_Oracle函数(php oci),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:php oci8,php fetchall,php oci8,php oci8,php fetch,php occ,php oci8,php oci,内容如对您有帮助,希望把文章链接给更多的朋友!

(PHP 5, PECL OCI8 >= 1.1.0)

oci_fetch — Fetches the next row into result-buffer

说明 bool oci_fetch ( resource $statement )

oci_fetch() 获取下一行(对于 SELECT 语句)到内部结果缓冲区。

Note:

在 PHP 5.0.0 之前的版本必须使用 ocifetch() 替代本函数。该函数名仍然可用,为向下兼容作为 oci_fetch() 的别名。不过其已被废弃,不推荐使用。

参数

statement

有效的 OCI8 报表标识符由 oci_parse() 创建,被 oci_execute()或 REF CURSOR statement 标识执行。

返回值 PHP:oci_fetch()的用法_Oracle函数(php oci)

Returns TRUE on success or FALSE if there are no more rows in the statement.

范例

Example #1 oci_fetch() with defined variables

<?php$conn=oci_connect('hr','welcome','localhost/XE');if(!$conn){$e=oci_error();trigger_error(htmlentities($e['message'],ENT_QUOTES),E_USER_ERROR);}$sql='SELECTlocation_id,cityFROMlocationsWHERElocation_id<';$stid=oci_parse($conn,$sql);//ThedefinesMUSTbedonebeforeexecutingoci_define_by_name($stid,'LOCATION_ID',$locid);oci_define_by_name($stid,'CITY',$city);oci_execute($stid);//Eachfetchpopulatesthepreviouslydefinedvariableswiththenextrow'sdatawhile(oci_fetch($stid)){echo"Locationid$locidis$city<br>n";}//

Example #2 oci_fetch() with oci_result()

<?php$conn=oci_connect('hr','welcome','localhost/XE');if(!$conn){$e=oci_error();trigger_error(htmlentities($e['message'],ENT_QUOTES),E_USER_ERROR);}$sql='SELECTlocation_id,cityFROMlocationsWHERElocation_id<';$stid=oci_parse($conn,$sql);oci_execute($stid);while(oci_fetch($stid)){echooci_result($stid,'LOCATION_ID')."is";echooci_result($stid,'CITY')."<br>n";}//

注释

Note:

In PHP versions before 5.0.0 use ocifetch() instead. 在当前版本中,旧的函数名还可以被使用,但已经被废弃并不建议使用。

参见

oci_define_by_name() - 在 SELECT 中使用 PHP 变量作为定义的步骤 oci_fetch_all() - 获取结果数据的所有行到一个数组 oci_fetch_array() - Returns the next row from a query as an associative or numeric array oci_fetch_assoc() - Returns the next row from a query as an associative array oci_fetch_object() - Returns the next row from a query as an object oci_fetch_row() - Returns the next row from a query as a numeric array oci_result() - 返回所取得行中字段的值

PHP:oci_commit()的用法_Oracle函数 oci_commit(PHP5,PECLOCI8=1.1.0)oci_commit提交未执行的事务处理说明booloci_commit(resource$connection)oci_commit()将Oracle连接connection上正在运行的事务中所有未执行的语句

PHP:oci_get_implicit_resultset()的用法_Oracle函数 oci_get_implicit_resultset(PECLOCI8=2.0.0)oci_get_implicit_resultsetReturnsthenextchildstatementresourcefromaparentstatementresourcethathasOracleDatabasecImplicitResultSets说明resourceoci_get_impl

PHP:oci_free_statement()的用法_Oracle函数 oci_free_statement(PHP5,PECLOCI8=1.1.0)oci_free_statement释放关联于语句或游标的所有资源说明booloci_free_statement(resource$statement)oci_free_statement()释放关联于Oracle游标或

本文链接地址:https://www.jiuchutong.com/biancheng/275251.html 转载请保留说明!

上一篇:PHP:oci_fetch()的用法_Oracle函数(php oci8)

下一篇:PHP:oci_commit()的用法_Oracle函数

免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

鄂ICP备2023003026号

网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

友情链接: 武汉网站建设 电脑维修 湖南楚通运网络