我在php手册中查找,发现两个功能与我非常相似:
mysqli_result::$field_count or mysqli_num_fields
和
mysqli::$field_count or mysqli_field_count()
它们有什么不同吗?
解决方法:
这可能会有所帮助:
Object oriented style
int mysqli->field_count ;
Procedural style
int mysqli_field_count(mysqli link);
Returns the number of columns for the most recent query on the connection represented by the link parameter. This function can be useful when using the mysqli_store_result function to determine if the query should have produced a non-empty result set or not without knowing the nature of the query.
有关更多详细信息,请访问此处:http://dev.mysql.com/doc/apis-php/en/apis-php-mysqli.field-count.html
Object oriented style
int mysqli_result->field_count ;
Procedural style
int mysqli_num_fields(mysqli_result result);
Returns the number of fields from specified result set.
有关更多详细信息,请访问此处:http://dev.mysql.com/doc/apis-php/en/apis-php-mysqli-result.field-count.html
您可以看到,在两种情况下,一种都收到输入,而另一种没有