[Mapserver-users] Read all fields of dbf file when querying

Daniel Morissette morissette@dmsolutions.ca
Thu, 07 Aug 2003 10:47:20 -0400


Stefan Schwarzer wrote:
> Thanks Daniel,
> 
> but unfortunately I do not know the names of the fields, so that I can't 
> access the fields like "$population = $shape->values["Population"];", 
> but rather I should retrieve the results by using the column-number [0, 
> 1, 2, ....]. But this does not work. Any further suggestion?
> 

You could possibly walk the array using the following kind of loop ot 
either dump the values or figure the name of the fields.
(This is untested code BTW)

   while( list($key, $val) = each( $shape->values ) )
   {
     echo $key . " = " . $val;
   }

Daniel
-- 
------------------------------------------------------------
  Daniel Morissette               morissette@dmsolutions.ca
  DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------

_______________________________________________
Mapserver-users mailing list
Mapserver-users@lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users