mysql_field_flags(result,offset)

Description: Returns the flags associated with a specified field in a result.

After calling mysql_list_fields(), mysql_query(), or another function that returns a resource identifier given by result, mysql_field_flags() returns the flags of a given field indexed by offset. Flags are returned as a string of text separated by spaces, including any of the following: auto_increment, not_null, primary_key, unique_key, multiple_key, blob, unsigned, zerofill, binary, enum, timestamp, or according to the version of MySQL in use.

Example:

 $result = mysql_list_fields ("cms", "subscribers"); $flags = mysql_field_flags ($result, 0); // offset of 0 means the first column $flags_array = explode (" ", $flags); while (list ($k,$flag) ...

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.