Query: pg_field_num
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
PG_FIELD_NUM(3) PG_FIELD_NUM(3) pg_field_num - Returns the field number of the named fieldSYNOPSISint pg_field_num (resource $result, string $field_name)DESCRIPTIONpg_field_num(3) will return the number of the field number that corresponds to the $field_name in the given PostgreSQL $result resource. Note This function used to be called pg_fieldnum(3).PARAMETERSo $result - PostgreSQL query result resource, returned by pg_query(3), pg_query_params(3) or pg_execute(3) (among others). o $field_name - The name of the field.RETURN VALUESThe field number (numbered from 0), or -1 on error.EXAMPLESExample #1 Getting information about fields <?php $dbconn = pg_connect("dbname=publisher") or die("Could not connect"); $res = pg_query($dbconn, "select author, year, title from authors where author = 'Orwell'"); echo "Column 'title' is field number: ", pg_field_num($res, 'title'); ?> The above example will output: Column 'title' is field number: 2SEE ALSOpg_field_name(3). PHP Documentation Group PG_FIELD_NUM(3)
Related Man Pages |
---|
pg_fetch_all_columns(3) - php |
pg_field_name(3) - php |
pg_field_table(3) - php |
pg_field_type(3) - php |
pg_free_result(3) - php |
Similar Topics in the Unix Linux Community |
---|
How to pad spaces |
help with this one please |
to do with awk |
Putting values into order in a field using awk |
Assigning Column Values to ARRAY in ksh |