Returns the definition of one column of a result set as a
MYSQL_FIELD structure. Call this function
repeatedly to retrieve information about all columns in the
NULL when no more fields are left.
For metadata-optional connections, this function returns
NULL when the
variable is set to
NONE. To check whether a
result set has metadata, use the
function. For details about managing result set metadata
transfer, see Section 3.6.7, “Optional Result Set Metadata”.
mysql_fetch_field() is reset
to return information about the first field each time you
execute a new
SELECT query. The
field returned by
mysql_fetch_field() is also
affected by calls to
If you've called
mysql_query() to perform a
SELECT on a table but have not
MySQL returns the default blob length (8KB) if you call
mysql_fetch_field() to ask for
the length of a
(The 8KB size is chosen because MySQL does not know the
maximum length for the
This should be made configurable sometime.) Once you've
retrieved the result set,
field->max_length contains the length of
the largest value for this column in the specific query.
MYSQL_FIELD structure for the current
NULL if no columns are left or the
result set has no metadata.