tailieunhanh - Hướng dẫn sử dụng MySQL part 21

MySQL C API Các MySQL C API sử dụng một số kiểu dữ liệu được xác định ngoài các loại C tiêu chuẩn. Những loại được định nghĩa trong tập tin header của 'mà phải được đưa vào khi biên soạn các chương trình sử dụng thư viện MySQL. | DRAFT 8 24 01 24 C Reference MySQL C API The MySQL C API uses several defined datatypes beyond the standard C types. These types are defined in the header file that must be included when compiling any program that uses the MySQL library. Datatypes MYSQL A structure representing a connection to the database server. The elements of the structure contain the name of the current database and information about the client connection among other things. MYSQL_FIELD A structure containing all of the information concerning a specific field in the table. Of all of the types created for MySQL this is the only one whose member variables are directly accessed from client programs. Therefore it is necessary to know the layout of the structure char name The name of the field. char table The name of the table containing this field. For result sets that do not correspond to real tables this value is null. char def The default value of this field if one exists. This value will always be null unless mysql_list_fields is called after which this will have the correct value for fields that have defaults. enum enumjield_types type Copyright 2001 O Reilly Associates Inc. 1 DRAFT 8 24 01 The type of the field. The type is one of the MySQL SQL datatypes. The following field types along with their corresponding MySQL SQL data type are currently defined FIELD_TYPE_TINY TINYINT FIELD_TYPE_SHORT SMALLINT FIELD_TYPE_LONG INTEGER FIELD_TYPE_INT24 MEDIUMINT FIELD_TYPE_LONGLONG BIGINT FIELD_TYPE_DECIMAL DECIMAL or NUMERIC FIELD_TYPE_FLOAT FLOAT FIELD_TYPE_DOUBLE DOUBLE or REAL FIELD_TYPE_TIMESTAMP TIMESTAMP FIELD_TYPE_DATE DATE FIELD_TYPE_TIME TIME FIELD_TYPE_DATETIME DATETIME FIELD_TYPE_YEAR YEAR FIELD_TYPE_STRING CHAR or VARCHAR FIELD_TYPE_BLOB BLOB or TEXT FIELD_TYPE_SET SET FIELD_TYPE_ENUM ENUM FIELD_TYPE_NULL NULL FIELD_TYPE_CHAR TINYINT Deprecated replaced by FIELD_TYPE_TINY unsigned int length The size of the field based on the field s type. unsigned int max_length If accessed after

TỪ KHÓA LIÊN QUAN