O'Reilly logo

MySQL in a Nutshell by Russell J.T. Dyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

C API Datatypes

Here is a list of C API datatypes from the mysql.h header file:

MYSQL

A database handle structure created by mysql_init( ) and released with mysql_close( ).

MYSQL_RES

A structure for a results set from an SQL query. This structure is used by fetch functions and is released with mysql_free_result().

MYSQL_ROW

A structure for holding a row of data from a results set. The data is retrieved from this structure by using the mysql_fetch_row( ) function.

MYSQL_FIELD

A structure for holding an array of information about a field of a results set. The array may be set with the mysql_fetch_field( ) function. The elements include name, table, and def for default value.

MYSQL_FIELD_OFFSET

Used for recording a pointer location for a results set. The offset value can be retrieved by the mysql_row_tell( ) function and deployed with mysql_row_seek( ).

my_ulonglong

A variable type for storing the number of rows for functions such as mysql_affected_rows( ), mysql_num_rows( ), and mysql_insert_id( ). To print the value of a variable using this type, the value should be copied to another variable that uses the unsigned long type.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required