PHP Doku:: Gibt eine Liste der Informix SQL Felder zurück - function.ifx-fieldtypes.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzDatenbankerweiterungenAnbieterspezifische DatenbankerweiterungenInformixInformix Funktionenifx_fieldtypes

Ein Service von Reinhard Neidl - Webprogrammierung.

Informix Funktionen

<<ifx_fieldproperties

ifx_free_blob>>

ifx_fieldtypes

(PHP 4, PHP <=5.2.0)

ifx_fieldtypesGibt eine Liste der Informix SQL Felder zurück

Beschreibung

array ifx_fieldtypes ( int $result_id )

Gibt für das Abfrageergebnis result_id ein assoziatives Array zurück mit den Feldnamen als Schlüssel und den SQL Feldtypen als Daten. Bei einem Fehler wird FALSE zurückgegeben.

Beispiel #1 Feldnamen und SQL Feldtypen

<?php
$types 
ifx_fieldtypes ($resultid);
if (! isset (
$types)) {
  
/* ... error ... */
}
foreach (
$types as $fname => $val) {
    echo 
"$fname:\t type = $val\n";
}
?>


Ein BenutzerBeitrag:
- Beiträge aktualisieren...
lord_edd at hotmail dot com
30.04.2002 15:46
Alternativly i found you can always do it like this using the foreach() loop...

    $types = @ifx_fieldtypes($resultid);
    if (isset($types))
    {
      foreach($types as $field_name => $data_type)
      {
         echo "{$field_name} {$data_type}";
      }
    }



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