[mapserver-users] Query by attributes with PHP/MapScript

Armin Burger armin.burger at libero.it
Thu Oct 3 04:33:00 EDT 2002


After some trials I found out that MapScript supports multicolumn
attribute queries via the 'setfilter()' method. The following worked
fine

$query = "(([AREA]>500000 AND [AREA]<=1000000) AND ([CODE]=311
             OR [CODE]=312))";
$layer->setFilter($query);
$layer->queryByAttributes(MS_MULTIPLE);

Its's even possible to include regular expressions in the query string.

Armin



More information about the mapserver-users mailing list