The MySQL C API uses several defined data types beyond the standard C types. These types are defined in the mysql.h header file that must be included when compiling any program that uses the MySQL library.
representing a connection to the database server. The program
allocates a variable of this type, initializes the variable through
call, and passes the variable
to subsequent calls. The elements of the structure contain the name
of the current database and information about the client connection,
among other things.
A structure containing all the information concerning a specific field in the table. Of all the types created for MySQL, this is the only one with member variables accessed directly from client programs. Therefore, you need to know the layout of the structure:
The name of the field.
The name of the table containing this field. For result sets that do not correspond to real tables, this value is null.
The default value of this field, if one exists. This value is always
mysql_list_fields is called, after
which it is the correct value for fields that have defaults.
enum enum_field_types type
The type of the field. The type is one of the internal MySQL SQL data types. The following field types (along with their corresponding common MySQL SQL data types) are currently defined: