Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP mysqli_field_count() Function

PHP mysqli_field_count() Function

PHP MySQLi Reference Manual PHP MySQLi Reference Manual

Assume we have a "websites" table with 5 fields and 20 rows. Return the number of columns from the most recent query:





Definition and Usage

The mysqli_field_count() function returns the number of columns from the most recent query.


Syntax

mysqli_field_count(

connection

)

;

Parameters Description
connection Required. Specifies the MySQL connection to use.

Technical Details

Return Value: Returns an integer representing the number of columns in the result set.
PHP Version: 5+

PHP MySQLi Reference Manual PHP MySQLi Reference Manual