Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 » SQL Anywhere Server - Programming » SQL Anywhere Data Access APIs » SQL Anywhere PHP API » SQL Anywhere PHP API reference

 

sasql_fetch_field

Prototype
object sasql_fetch_field( sasql_result $result [, int $field_offset ] )
Description

Returns an object that contains information about a specific column.

Parameters

$result   The result resource returned by the sasql_query function.

$field_offset   An integer representing the column/field on which you want to retrieve information. Columns are zero based; to get the first column, specify the value 0. If this parameter is omitted, then the next field object is returned.

Returns

An object that has the following properties:

  • id   contains the field's number

  • name   contains the field's name

  • numeric   indicates whether the field is a numeric value

  • length   returns the field's native storage size.

  • type   returns the field's type

  • native_type   returns the field's native type. These are values like DT_FIXCHAR, DT_DECIMAL or DT_DATE. See Embedded SQL data types.

  • precision   returns the field's numeric precision. This property is only set for fields with native_type equal to DT_DECIMAL.

  • scale   returns the field's numeric scale. This property is only set for fields with native_type equal to DT_DECIMAL.

Related functions