Description

This function serves an identical purpose to the
mysqli_fetch_field() function with the single
difference that, instead of returning one object at a time for each field,
the columns are returned as an array of objects.

Parameters

Return Values

Returns an array of objects which contains field definition information or
FALSE if no field information is available.

Object properties

Property

Description

name

The name of the column

orgname

Original column name if an alias was specified

table

The name of the table this field belongs to (if not calculated)

orgtable

Original table name if an alias was specified

max_length

The maximum width of the field for the result set.

length

The width of the field, in bytes, as specified in the table definition. Note that
this number (bytes) might differ from your table definition value (characters), depending on
the character set you use. For example, the character set utf8 has 3 bytes per character,
so varchar(10) will return a length of 30 for utf8 (10*3), but return 10 for latin1 (10*1).

NOT_NULL_FLAG 1 /* Field can't be NULL */PRI_KEY_FLAG 2 /* Field is part of a primary key */UNIQUE_KEY_FLAG 4 /* Field is part of a unique key */MULTIPLE_KEY_FLAG 8 /* Field is part of a key */BLOB_FLAG 16 /* Field is a blob */UNSIGNED_FLAG 32 /* Field is unsigned */ZEROFILL_FLAG 64 /* Field is zerofill */BINARY_FLAG 128 /* Field is binary */ENUM_FLAG 256 /* field is an enum */AUTO_INCREMENT_FLAG 512 /* field is a autoincrement field */TIMESTAMP_FLAG 1024 /* Field is a timestamp */SET_FLAG 2048 /* field is a set */NO_DEFAULT_VALUE_FLAG 4096 /* Field doesn't have default value */ON_UPDATE_NOW_FLAG 8192 /* Field is set to NOW on UPDATE */NUM_FLAG 32768 /* Field is num (for clients) */PART_KEY_FLAG 16384 /* Intern; Part of some key */GROUP_FLAG 32768 /* Intern: Group field */UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */BINCMP_FLAG 131072 /* Intern: Used by sql_yacc */GET_FIXED_FIELDS_FLAG (1 << 18) /* Used to get fields in item tree */FIELD_IN_PART_FUNC_FLAG (1 << 19)/* Field part of partition func */