[postgis-users] Identifying field names in select out of order

Sean M. Montague smontague at ATSDenver.com
Mon Feb 20 15:53:49 PST 2006


This is PostgreSQL specific question. I'm iterating through my selection
and need to get the field name of my data[$i] where
$data=pg_fetch_row($result, $i). I've tried pg_fieldname($result, $i),
but the problem is that the field names in the select statement are not
in the same order as the db, so pg_fieldname(result, $i) is not the
filed from which data[$i] is drawn from.  Is there another way of
determining which field data[$i] comes from regardless of the field
order?  Thank you.

Sean



More information about the postgis-users mailing list