PHP Doku:: Returns an object with the column names - function.cubrid-fetch-object.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzDatenbankerweiterungenAnbieterspezifische DatenbankerweiterungenCubridCubrid Funktionencubrid_fetch_object

Ein Service von Reinhard Neidl - Webprogrammierung.

Cubrid Funktionen

<<cubrid_fetch_lengths

cubrid_fetch_row>>

cubrid_fetch_object

(PECL CUBRID >= 8.3.0)

cubrid_fetch_objectReturns an object with the column names

Beschreibung

object cubrid_fetch_object ( resource $req_identifier [, string $class_name [, array $params ]] )

This function returns an object with the column names of the result set as properties. The values of these properties are extracted from the current row of the result.

Parameter-Liste

req_identifier

This is the request identifier.

class_name

The name of the class to instantiate, set the properties of and return. If not specified, a stdClass object is returned.

params

An optional array of parameters to pass to the constructor for class_name objects.

Rückgabewerte

An object, when process is successful.

FALSE on failure.

Beispiele

Beispiel #1 cubrid_fetch_object() 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_object($result);
        echo 
$row->name."<BR>";
        echo 
$row->address."<BR>";
        echo 
$row->salary;
        
        
cubrid_close_request($result); 
    }
?>

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

Result:
Peter
1st Avenue, New York
1000.0000000000000000

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