PHP Mapscript Query Help Needed

Steve Benzo steve_benzo at YAHOO.COM
Wed Aug 24 12:09:42 EDT 2005


Hi,

I have the following PHP mapscript query which is
working well, with one exception. Instead of returning
column headings (ie FID, Name) I am getting item
numbers (ie 0, 1). So, I would like to be able to get
those headings, and not the numbers. Can someone
please take a look at my code below and see what needs
to be addressed..... Thanks in advance.

///////////////////////////////////code below

 if(@$layer->queryByPoint($point, MS_SINGLE, -1) ==
MS_SUCCESS)
  {

   $layer->open();
   $items=$layer->getitems();

   $a = $layer->getNumResults();
   echo "Features: $a<br/>";
   //outputs 1 feature

   $oShape =
$layer->getShape($oResult->tileindex,$oResult->shapeindex);

   $data = $oShape->values;

   foreach($items as $key => $valX)
   {
    echo $key . ": " . $data[$items[$key]] . " <br/>";
    //outputs 0: 0.35241699
    //outputs 1: 3.61586343 
   }

//////////////////////////////


		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 



More information about the mapserver-users mailing list