September 2001
Intermediate to advanced
768 pages
32h 45m
English
int mysql_num_fields(mysql result result_handle) Gets the number of fields in a MySQL result handle.
Returns:
Integer; NULL on error
Description:
mysql_num_fields() returns the number of fields that exist in each row of a MySQL result handle.
Version:
PHP 3+, PHP 4+
See also:
To find the number of rows in a result handle:
mysql_num_rows()
Example:
<?php // Included code that connects to a MySQL server and sets a default database // See the MySQL Functions chapter introduction for the source code for the file include ('mysql_connect.inc.php'); // Get the current time and UNIX timestamp $query = "SELECT * FROM user"; // Suppress errors for each line below with a single at ... |
Read now
Unlock full access