(PECL CUBRID >= 8.3.0)
cubrid_fetch_lengths — Returns an array with the lengths of the values of each field from the current row
This function returns an numeric array with the lengths of the values of each field from the current row of the result set or it returns FALSE on failure.
This is the request identifier.
An numeric array, when process is successful.
FALSE on failure.
例1 cubrid_fetch_lengths() example
<?php
$link = cubrid_connect("localhost", 30000, "demodb2", "dba", "");
if (!$link)
{
die('Could not connect.');
}
$query = 'SELECT name, address, salary FROM employees';
$result = cubrid_execute($link, $query);
if ($result)
{
$row= cubrid_fetch_assoc($result);
$lengths = cubrid_fetch_lengths($result);
print_r($row);
echo "<br>";
print_r($lengths);
cubrid_close_request($result);
}
?>
上の例の出力は以下となります。
Result: Array ( [name] => Peter [address] => 1st Avenue, New York [salary] => 1000.0000000000000000 ) Array ( [0] => 5 [1] => 20 [2] => 21 )