PHP Doku:: Returns an array with the lengths of the values of each field from the current row - function.cubrid-fetch-lengths.html

Verlauf / Chronik / History: (14) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzDatenbankerweiterungenAnbieterspezifische DatenbankerweiterungenCubridCubrid Funktionencubrid_fetch_lengths

Ein Service von Reinhard Neidl - Webprogrammierung.

Cubrid Funktionen

<<cubrid_fetch_field

cubrid_fetch_object>>

cubrid_fetch_lengths

(PECL CUBRID >= 8.3.0)

cubrid_fetch_lengthsReturns an array with the lengths of the values of each field from the current row

Beschreibung

array cubrid_fetch_lengths ( resource $req_identifier )

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.

Hinweis:

If field data type is BLOB/CLOB, you should get its length by using cubrid_lob_size().

Parameter-Liste

req_identifier

This is the request identifier.

Rückgabewerte

An numeric array, when process is successful.

FALSE on failure.

Beispiele

Beispiel #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
    {
        
$rowcubrid_fetch_assoc($result);
        
$lengths cubrid_fetch_lengths($result);
        
print_r($row);
        echo 
"<br>";
        
print_r($lengths);
        
cubrid_close_request($result); 
    }
?>

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

Result:
Array ( [name] => Peter [address] => 1st Avenue, New York [salary] => 1000.0000000000000000 ) 
Array ( [0] => 5 [1] => 20 [2] => 21 )

Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)