mysql_fetch_field_direct是给定结果集内某1列的字段编号fieldnr,以MYSQL_FIELD结构形式返回列的字段定义。可以使用该函数检索任意列的定义。Fieldnr的值应在从0到mysql_num_fields(result)-1的范围内。对于指定列,返回MYSQL_FIELD结构。没有错误。头文件 #include 函数原型 MYSQL_FIELD *mysql_fetch_field_direct...
*field;while((field=mysql_fetch_field(result))){printf("field name %s\n",field->name);}
百度试题 结果1 题目mysqli_fetch_field() 函数从结果集中取得下一字段(列),并作为对象返回。相关知识点: 试题来源: 解析 错误 反馈 收藏
mysql_fetch_field() 返回的字段也受 mysql_field_seek() 调用的影响。如果已经调用 mysql_real_query() 或mysql_query() 对表执行 SELECT, 但没有调用 mysql_store_result(),在这种情况下,调用 mysql_fetch_field() 询问BLOB 的长度时,OceanBase 将返回 BLOB 字段的默认长度 (8 KB)。
这里的fieldnr是一个整数,它代表字段在结果集中从0开始的索引,其范围应该在0到mysql_num_fields(result)减1之间,其中mysql_num_fields(result)表示结果集中列的数量。通过调用mysql_fetch_field_direct,你可以针对任意列获取其字段类型、名称、长度、是否可为空等属性信息。这个函数执行时,如果指定的...
mysql_fetch_field_direct(MYSQL_RES *result, unsigned int fieldnr) The value offieldnrranges from 0 tomysql_num_fields(result)-1. Return values TheMYSQL_FIELDstructure for the specified column is returned. Errors None. Notes You can use this function to retrieve the definition for an arbitrary...
MYSQL_FIELD * mysql_fetch_field_direct(MYSQL_RES * res, unsigned int fieldnr); res - a result set identifier returned by mysql_store_result() or mysql_use_result(). fieldnr - the field number. This value must be within the range from 0 to number of fields - 1 Description Return...
在使用 mysql_fetch_field 时,确保查询结果有值 例:result = mysql_query("select * from table")if($result){ 再在里执行 }
MYSQL_FIELD * mysql_fetch_field_direct(MYSQL_RES *result, unsigned int fieldnr) Description Given a field numberfieldnrfor a column within a result set, returns that column's field definition as aMYSQL_FIELDstructure. Use this function to retrieve the definition for an arbitrary column. Specify...