[mapserver-users] php Mapscript queryByAttributes

Carlos Ruiz boolean10001 at yahoo.com
Wed Oct 11 11:35:38 PDT 2017


Sven,

Doing some tests, queryByAttributes does not accept LIKE nor IN, just single values or simple operators (I am using PostGIS).

queryByAttributes("gid", "gid > 100", MS_MULTIPLE) // does not found anythingqueryByAttributes("gid", "100", MS_MULTIPLE) // found one resultqueryByAttributes("municipio", "'GUADALAJARA'", MS_MULTIPLE) // found one resultqueryByAttributes("municipio", "municipio LIKE 'G%'", MS_MULTIPLE) // does not found anythingqueryByAttributes("gid", "([gid] IN (100, 101))", MS_MULTIPLE); // query error
queryByAttributes("municipio", "([municipio] LIKE 'G%')", MS_MULTIPLE); // query errorqueryByAttributes("gid", "([gid] > 100)", MS_MULTIPLE); // found 25 results

MS4W version is 3.1.3

 Try to solve it by using FILTER, which allows more complex expressions:

$layer->setFilter("gid IN (100, 101)");

Cheers

   On Wednesday, October 11, 2017, 10:55:17 AM CDT, Sven Schroeter <schroeter at netgis.de> wrote:  
 
 Hi,

Old Server: PHP 5.4.36 with MS 6.4.1 (MS4W)
New Server: PHP 5.6.31 with MS 7.0.6 (MS4W 3.2.2)

My Test Script:

$qfield = 'gid';
$qstring = "gid IN (1,2,3)";
@$datQuery = $query_layer->queryByAttributes($qfield,$qstring,MS_MULTIPLE);

Works fine on the old Server, on the new Server no result.

I have tried to change the query expression, i.e.:
$qstring = "('[gid]' in '1,2,3')";

No result on old server and new...

How can I get it run on MS7?



Thanks + greetings 
Sven 
 


**************************************
NETGIS GbR
Benediktinerstr. 32a
54292 Trier
Tel.: 0651-1704731
Fax: 0651-1704733
schroeter at netgis.de
www.netgis.de


_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20171011/02207c25/attachment.htm>


More information about the MapServer-users mailing list