PHP mysqli_field_count() Function
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