PHP
downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

sybase_fetch_object> <sybase_fetch_assoc
Last updated: Fri, 26 Dec 2008

view this page in

sybase_fetch_field

(PHP 4, PHP 5)

sybase_fetch_fieldobtiene la información del campo

Descripción

object sybase_fetch_field ( int $result [, int $field_offset ] )

Devuelve un objeto conteniendo la información del campo

sybase_fetch_field() puede usarse para obtener información sobre los campos de una consulta determinada. Si no se específica el offset del campo, el siguiente campo que aún no halla sido tomado por sybase_fetch_field() es el que se obtiene.

Las propiedades del objeto son:

  • name - nombre de la columna. si la columna es el resultado de una función, esta propiedad se establece a computed#N, donde #N es un número de serie.
  • column_source - la tabla de la cual se tomo la columna
  • max_length - máxima longitud de la columna
  • numeric - 1 si la columna es numérica

Vea también sybase_field_seek().



add a note add a note User Contributed Notes
sybase_fetch_field
anthony dot leung at virgin dot net
25-Jun-2003 06:44
Bit short on comments and tips bout this one so head down to mysql_fetch_fields where the concept is the same. I seemed to get an infinite loop over there using the $i counter tho, so I used a for loop instead.
The list of properties you can get from what I've called $info is in the example to the mysql equivalent.

//start of an example to print out column headings

echo "<table><tr>";
  $numfields=sybase_num_fields($query);
  for ($f=0;$f<=$numfields;$f++){
    $info = sybase_fetch_field($query);
    echo "<td> $info->name </td>";
  }
  echo "</tr><tr>";
gray at voicenet dot com
15-Oct-1999 10:27
The 'type' field contains (roughly) the datatype of the source column.  Types returned are:

  'type'   Sybase Type
  -------  --------------------------
  string   CHAR, VARCHAR, TEXT
  image    IMAGE
  blob     BINARY, VARBINARY
  bit      BIT
  int      TINYINT, SMALLINT, INT
  real     REAL, FLOAT, NUMERIC, DECIMAL
  money    MONEY
  datetime DATETIME, SMALLDATETIME

sybase_fetch_object> <sybase_fetch_assoc
Last updated: Fri, 26 Dec 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites