Query: mysql_num_fields
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
MYSQL_NUM_FIELDS(3) 1 MYSQL_NUM_FIELDS(3) mysql_num_fields - Get number of fields in resultSYNOPSISWarning This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include: omysqli_field_count(3) o PDOStatement::columnCount int mysql_num_fields (resource $result)DESCRIPTIONRetrieves the number of fields from a query. o $ result -The result resource that is being evaluated. This result comes from a call to mysql_query(3). Returns the number of fields in the result set resource on success or FALSE on failure. Example #1 A mysql_num_fields(3) example <?php $result = mysql_query("SELECT id,email FROM people WHERE id = '42'"); if (!$result) { echo 'Could not run query: ' . mysql_error(); exit; } /* returns 2 because id,email === two fields */ echo mysql_num_fields($result); ?> Note For backward compatibility, the following deprecated alias may be used: mysql_numfields(3) mysql_select_db(3), mysql_query(3), mysql_fetch_field(3), mysql_num_rows(3). PHP Documentation Group MYSQL_NUM_FIELDS(3)
| Related Man Pages |
|---|
| mysql_num_rows(3) - php |
| mysql_num_fields(3) - php |
| mysql_fetch_lengths(3) - php |
| mysql_fetch_row(3) - php |
| mysql_field_type(3) - php |
| Similar Topics in the Unix Linux Community |
|---|
| UNIX for Dummyes |
| send mail script only if condition is met |