PHP mysqli_fetch_field() Function

Object oriented style

object mysqli_result::fetch_field ( void )

Procedural style

object mysqli_fetch_field ( mysqli_result $result )

Returns the definition of one column of a result set as an object. Call this function repeatedly to retrieve information about all columns in the result set.

The mysqli_fetch_field() function returns the next field (column) in the result set, as an object.

Examples -

Object oriented style

Procedural style

The above examples will output:

Name: Name Table: Country max. Len: 11 Flags: 1 Type: 254

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().

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