(PECL CUBRID >= 8.3.0)
cubrid_fetch_lengths — 返回一个包含当前行每个字段的值长度的数组
此函数返回一个包含结果集当前行每个字段的值长度的数字数组,或者在失败时返回 FALSE。
注意:
如果字段数据类型为 BLOB/CLOB,则应使用 cubrid_lob_size() 获取其长度。
示例 #1 cubrid_fetch_lengths() 示例
<?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 )