PHP8 cubrid_fetch_lengths

2024-03-29 09:17 更新

(PECL CUBRID >= 8.3.0)

cubrid_fetch_lengths — 返回一個數(shù)組,其中包含當前行中每個字段值的長度

說明

cubrid_fetch_lengths(resource $result): array

此函數(shù)返回一個數(shù)值數(shù)組,其值的長度為 結(jié)果集當前行中的每個字段,否則返回 FALSE 失敗。

注意:如果字段數(shù)據(jù)類型為 BLOB/CLOB,則應使用 cubrid_lob_size() 獲取其長度。

參數(shù) 

result

result來自對 cubrid_execute() 的調(diào)用

返回值 

一個數(shù)值數(shù)組,當進程成功時。

失敗時為 false。

示例 

示例 #1 cubrid_fetch_lengths() example

<?php
$conn = cubrid_connect("localhost", 33000, "demodb");
$result = cubrid_execute($conn, "SELECT * FROM game WHERE host_year=2004 AND nation_code='AUS' AND medal='G'");

$row = cubrid_fetch_row($result);
print_r($row);

$lens = cubrid_fetch_lengths($result);
print_r($lens);

cubrid_disconnect($conn);
?>

以上示例會輸出:

Array
(
    [0] => 2004
    [1] => 20085
    [2] => 15118
    [3] => 30134
    [4] => AUS
    [5] => G
    [6] => 2004-8-20
)
Array
(
    [0] => 4
    [1] => 5
    [2] => 5
    [3] => 5
    [4] => 3
    [5] => 1
    [6] => 10
)


以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號