fbsql_fetch_field(3) php man page | unix.com

Man Page: fbsql_fetch_field

Operating Environment: php

Section: 3

FBSQL_FETCH_FIELD(3)							 1						      FBSQL_FETCH_FIELD(3)

fbsql_fetch_field - Get column information from a result and return as an object

SYNOPSIS
object fbsql_fetch_field (resource $result, [int $field_offset])
DESCRIPTION
Used in order to obtain information about fields in a certain query result.
PARAMETERS
o $ result -A result identifier returned by fbsql_query(3) or fbsql_db_query(3). o $field_offset - The numerical offset of the field. The field index starts at 0. If not specified, the next field that wasn't yet retrieved by fbsql_fetch_field(3) is retrieved.
RETURN VALUES
Returns an object containing field information, or FALSE on errors. The properties of the object are: o name - column name o table - name of the table the column belongs to o max_length - maximum length of the column o not_null - 1 if the column cannot be NULL o type - the type of the column
EXAMPLES
Example #1 fbsql_fetch_field(3) example <?php fbsql_connect($host, $user, $password) or die("Could not connect"); $result = fbsql_db_query("database", "select * from table") or die("Query failed"); # get column metadata $i = 0; while ($i < fbsql_num_fields($result)) { echo "Information for column $i:<br /> "; $meta = fbsql_fetch_field($result); if (!$meta) { echo "No information available<br /> "; } echo "<pre> max_length: $meta->max_length name: $meta->name not_null: $meta->not_null table: $meta->table type: $meta->type </pre>"; $i++; } fbsql_free_result($result); ?>
SEE ALSO
fbsql_field_seek(3). PHP Documentation Group FBSQL_FETCH_FIELD(3)
Related Man Pages
cubrid_fetch_field(3) - php
cubrid_field_flags(3) - php
mysql_field_flags(3) - php
mysqli_fetch_field_direct(3) - php
pg_field_name(3) - php
Similar Topics in the Unix Linux Community
Add new column in Text File
How to use awk for printing line from database table?
select value from 'value' column if the Value2 is having a particular value.
Find &amp; Replace identifiers using a conversion table
Sum column values based in common identifier in 1st column.