PHP Doku:: Moves the result set cursor to the specified field offset - function.cubrid-field-seek.html

Verlauf / Chronik / History: (2) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzDatenbankerweiterungenAnbieterspezifische DatenbankerweiterungenCubridCubrid Funktionencubrid_field_seek

Ein Service von Reinhard Neidl - Webprogrammierung.

Cubrid Funktionen

<<cubrid_field_name

cubrid_field_table>>

cubrid_field_seek

(PECL CUBRID >= 8.3.0)

cubrid_field_seekMoves the result set cursor to the specified field offset

Beschreibung

bool cubrid_field_seek ( resource $req_identifier , int $field_offset )

This function moves the result set cursor to the specified field offset. This offset is used by cubrid_fetch_field() if it doesn't include a field offset. It returns TRUE on success or FALSE on failure.

Parameter-Liste

req_identifier

This is the request identifier.

field_offset

The numerical field offset. The field_offset starts at 0. If field_offset does not exist, an error of level E_WARNING is also issued.

Rückgabewerte

TRUE on success.

FALSE on failure.

Beispiele

Beispiel #1 cubrid_field_seek() example

<?php
    $link 
cubrid_connect("localhost"30000"demodb2""dba""");
    if (!
$link)
    {
        die(
'Could not connect.');
    }
    
$query 'SELECT id, name, address, salary FROM employees';
    
$result cubrid_execute($link$query);
    if (
$result
    {
        
cubrid_field_seek($result,2);
        
$meta cubrid_fetch_field($result);
        if (!
$meta
        {
            echo 
"No information available<br />\n";
        }
        echo 
"<pre>
        max_length:        
$meta->max_length
        multiple_key:        
$meta->multiple_key
        name:            
$meta->name
        not_null:        
$meta->not_null
        numeric:        
$meta->numeric
        table:            
$meta->table
        type:            
$meta->type
        default:        
$meta->def
        unique_key:        
$meta->unique_key
        </pre>"
;


        
cubrid_close_request($result); 
    }
?>

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

Result:
    max_length:        21
    multiple_key:        1
    name:            address
    not_null:        0
    numeric:            0
    table:            employees
    type:            STRING
    default:        
    unique_key:        0

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",...)