成人精品一区二区三区中文字幕-成人精品一区二区三区-成人精品一级毛片-成人精品亚洲-日本在线视频一区二区-日本在线视频免费

導(dǎo)航首頁 ? 技術(shù)教程 ? PHP:oci_fetch()的用法_Oracle函數(shù)
全站頭部文字 我要出現(xiàn)在這里
PHP:oci_fetch()的用法_Oracle函數(shù) 752 2023-12-12   

oci_fetch

(PHP 5, PECL OCI8 >= 1.1.0)

oci_fetch — Fetches the next row into result-buffer

說明

bool oci_fetch ( resource $statement )

oci_fetch() 獲取下一行(對于 SELECT 語句)到內(nèi)部結(jié)果緩沖區(qū)。

Note:

在 PHP 5.0.0 之前的版本必須使用 ocifetch() 替代本函數(shù)。該函數(shù)名仍然可用,為向下兼容作為 oci_fetch() 的別名。不過其已被廢棄,不推薦使用。

參數(shù)

statement

有效的 OCI8 報(bào)表標(biāo)識(shí)符 由 oci_parse() 創(chuàng)建,被 oci_execute() 或 REF CURSOR statement 標(biāo)識(shí)執(zhí)行。

返回值

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 = 'SELECT location_id, city FROM locations WHERE location_id < 1200';
$stid = oci_parse($conn, $sql);

// The defines MUST be done before executing
oci_define_by_name($stid, 'LOCATION_ID', $locid);
oci_define_by_name($stid, 'CITY', $city);

oci_execute($stid);

// Each fetch populates the previously defined variables with the next row's data
while (oci_fetch($stid)) {
    echo "Location id $locid is $city<br>n";
}

// Displays:
//   Location id 1000 is Roma
//   Location id 1100 is Venice

oci_free_statement($stid);
oci_close($conn);

?>

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 = 'SELECT location_id, city FROM locations WHERE location_id < 1200';
$stid = oci_parse($conn, $sql);
oci_execute($stid);

while (oci_fetch($stid)) {
    echo oci_result($stid, 'LOCATION_ID') . " is ";
    echo oci_result($stid, 'CITY') . "<br>n";
}

// Displays:
//   1000 is Roma
//   1100 is Venice

oci_free_statement($stid);
oci_close($conn);

?>

注釋

Note:

In PHP versions before 5.0.0 use ocifetch() instead. 在當(dāng)前版本中,舊的函數(shù)名還可以被使用,但已經(jīng)被廢棄并不建議使用。

參見

oci_define_by_name() - 在 SELECT 中使用 PHP 變量作為定義的步驟 oci_fetch_all() - 獲取結(jié)果數(shù)據(jù)的所有行到一個(gè)數(shù)組 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() - 返回所取得行中字段的值


主站蜘蛛池模板: 妈妈的花样年华演员表全部| 孽债电视剧演员表| 凤凰电视台| 女人 电影| 黑色纳粹电影完整版| 88分钟| 西安地铁2号线运营时间表| 大追捕电影结局| 日本电视剧《阿信》| 出彩中国人撒贝宁精忠报国15分钟| 尤克里里指弹谱| 男女电视剧| 亚洲1区| 铠甲勇士第六部| 黑之教室| 超级飞侠 第四季 动漫| 拔萝卜电影| 91自拍网| 眉间尺| 《密爱》| 发型图片女2024最新款式| 陈妍希三级露全乳电影| 电影频道直播| 电影《重生》| 1到100数字表图片| 泰国《永恒/eternity》| 掐脖子自制短视频| 纳西三部曲| psv游戏| 无人驾驶 电影| 梁山伯与祝英台电影| 金刚狼1| 麻豆视频免费在线观看| 小孩几个月会翻身| 我的幸运猫 电视剧| 二丫的美好生活[年代]| 噜啊噜在线视频| 欲望中的女人电影| 上官于飞| 恶搞之家有几季| 小学三年级英语同步跟读app|

!!!站長長期在線接!!!

網(wǎng)站、小程序:定制開發(fā)/二次開發(fā)/仿制開發(fā)等

各種疑難雜癥解決/定制接口/定制采集等

站長微信:lxwl520520

站長QQ:1737366103