PHP mysqli_fetch_field_direct() Function

Object oriented style

object mysqli_result::fetch_field_direct ( int $fieldnr )

Procedural style

object mysqli_fetch_field_direct ( mysqli_result $result , int $fieldnr )

Returns an object which contains field definition information from the specified result set.

The mysqli_fetch_field_direct() function returns meta-data for a single field (column) in the result set, as an object.

Examples -

Object oriented style

Procedural style

The above examples will output:

Name: SurfaceArea

Table: Country

max. Len: 10

Flags: 32769

Type: 4

ParameterDescription
resultProcedural style only: A result set identifier returned by mysqli_query(), mysqli_store_result() or mysqli_use_result().
fieldnrThe field number. This value must be in the range from 0 to number of fields - 1.

Return Values

Returns an object which contains field definition information or FALSE if no field information for specified fieldnr is available.