[mapserver-users] Dynamin SQL with mapserver CGI?

Richard Greenwood richard.greenwood at gmail.com
Sat Jan 24 08:04:42 EST 2009


On Sat, Jan 24, 2009 at 3:18 AM, Saka Royban <srph124 at yahoo.com> wrote:
> Hi all
> I'm looking for a way to change SQL dynamically via URL parameters. it
> sounds from doc that changing DATA element in map file is impossible. Is
> there any other way?

You can use a replaceable parameter in the FILTER clause if all you
want to do is alter the WHERE clause. So for example:
   FILTER "%criteria%"
and
  criteria=id='value'
would work with a database like Postgres.

When working with a database you put the whole SQL WHERE clause in the
FILTER, whereas with shapefiles or ORG data sources you use the
FILTERITEM and FILTER.

-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com


More information about the mapserver-users mailing list