5.4.19 mysql_fetch_fields()
MYSQL_FIELD *
mysql_fetch_fields(MYSQL_RES *result)
MYSQL_FIELD
返回结果集的所有结构
的数组。每个结构为结果集中的一列提供字段定义。
unsigned int num_fields;
unsigned int i;
MYSQL_FIELD *fields;
num_fields = mysql_num_fields(result);
fields = mysql_fetch_fields(result);
for(i = 0; i < num_fields; i++)
{
printf("Field %u is %s\n", i, fields[i].name);
}