这里的fieldnr是一个整数,它代表字段在结果集中从0开始的索引,其范围应该在0到mysql_num_fields(result)减1之间,其中mysql_num_fields(result)表示结果集中列的数量。通过调用mysql_fetch_field_direct,你可以针对任意列获取其字段类型、名称、长度、是否可为空等属性信息。这个函数执行时,如果指定的...
mysqli_fetch_field_direct() 函数从结果集中取得某个单一字段(列)的 meta-data,并作为对象返回。 语法 mysqli_fetch_field_direct(result,fieldnr); 参数描述 result必需。规定由 mysqli_query()、mysqli_store_result() 或 mysqli_use_result() 返回的结果集标识符。
MYSQL_FIELD *f=NULL; printf("Fetching field: %d\n",field); f = mysql_fetch_field_direct(res,field); printf("char *name : %s\n",f->name); /* Name of column */ printf("char *table : %s\n",f->table); /* Table of column if column was a field */ ...
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...
mysqli_result::fetch_field_direct file: reference/mysqli/msqli_result/fetch-field-direct.xml The "returnvalues" section currently reads: Returns an object which contains field definition information or &false; if no field information for specified fieldnr is available. However, there is no 'fiel...
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...
MYSQL_FIELD*mysql_fetch_field_direct(MYSQL_RES*result,unsignedintfieldnr) 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 a value...
MYSQL_FIELD*mysql_fetch_field_direct(MYSQL_RES*result,unsignedintfieldnr) 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 a value...
MYSQL_FIELD * mysql_fetch_field_direct(MYSQL_RES * res, unsigned int fieldnr); res- a result set identifier returned bymysql_store_result()ormysql_use_result(). fieldnr- the field number. This value must be within the range from 0 to number of fields - 1 ...