Problems with queryByAttributes...

Lowell Filak lfilak at MEDINACO.ORG
Mon Sep 12 14:38:42 EDT 2005


The following message was sent by Juan Antonio Fernandez Prada
<juanantonio.fernandez at UCA.ES> on Mon, 12 Sep 2005 11:32:26 -0500.

> Hi List!
> 
> I'm trying to do a query by attributes with php, but I've got several
> problems. I've got some shapes, and I make a query with this code:
> 
> $oMap =ms_newMapObj("../data/campuspr.map" );
> $mySearchLayer = $oMap->getLayerByName("FCC_P0");
> $result =$mySearchLayer->queryByAttributes("FID","104",MS_SINGLE);
> $myresultImg = $oMap->drawQuery($result);
> 
> In my shape, the field FID is the key field, but it produces the following
> error: "Warning: [MapServer Error]: msDBFGetItemIndex(): Item 'FID' not
> found".
> 
> I tried to do the same with all the field of the table of the shape, but
> the error is the same. After a week trying it, now I haven't got any idea
> abaut do it. Could anybody help me?

Juan,

Is the case of the field name correct, ie. FID vs. fid?
Can you do something like 'dbfdump -info
<name_of_data_for_layer_FCC_P0>.dbf' to see what the field names look like?

Lowell



More information about the mapserver-users mailing list