OK I finally figured it out how to get my table fields listed I could not do it the way I was trying . It took a couple of different commands to get to it. I wrote a simple function (probably an extremely inefficiemt way of handling the problem)to fix it in my system. Here it is in case someone else wants to use it:
(this is for Postgres)
<?
/function that gets all field names from variables /
function get_field_names($specifiedtable){
$db=pg_connect("dbname=af");
$query="SELECT * FROM $specifiedtable";
$result=pg_exec($db,$query);
$row=0;
$myrow=pg_fetch_object($result,$row);
$some_fields=array_keys(get_object_vars($myrow));
$count=1;/*every other array value [1,3,5,...] is a field name I will use count to assign values so every value is an array in the array field_names */
$count2=0;
While ($count<sizeof($some_fields)){
$field_names[$count2]="$some_fields[$count]";
$count++;$count++;$count2++;}
return($field_names);}
Thanks
Isaiah