oci_result

(PHP 5, PHP 7, PHP 8, PECL OCI8 >= 1.1.0)

oci_result返回所取得行中字段的值

說明

oci_result(resource $statement, mixed $field): mixed

oci_result() 返回由 oci_fetch() 所取得的當(dāng)前行中 field 字段的數(shù)據(jù)。oci_result() 對(duì)所有類型都返回字符串只除了抽象類型(ROWID,LOB 和 FILE)。oci_result() 在出錯(cuò)時(shí)返回 false。

可以使用列序號(hào)(從 1 開始)或列名(大寫)作為 col 的參數(shù)。

注意:

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

要獲取 OCI8 擴(kuò)展進(jìn)行數(shù)據(jù)類型映射的細(xì)節(jié),請(qǐng)參見驅(qū)動(dòng)所支持的數(shù)據(jù)類型。

參見 oci_fetch_array()oci_fetch_assoc(),oci_fetch_object(),oci_fetch_row()oci_fetch_all()

參數(shù)

statement

field

Can be either use the column number (1-based) or the column name (in uppercase).

返回值

Returns everything as strings except for abstract types (ROWIDs, LOBs and FILEs). Returns false on error.

注釋

注意:

In PHP versions before 5.0.0 you must use ociresult() instead. This name still can be used, it was left as alias of oci_result() for downwards compatability. This, however, is deprecated and not recommended.

參見