FW: [mapserver-users] php-Mapscript and MySQL layer syntax

2011-07-06 Thread Chris Green
Hello to all, especially PHP-Mapscript users:

 

Apologies for asking the same question twice, but I got no responses to the
below and I am still stuck on both problems. Very happy to receive some help
on either but especially the first one..

 

 

Chris 

 

From: mapserver-users-boun...@lists.osgeo.org
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Chris Green
Sent: 27 June 2011 09:05
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] php-Mapscript and MySQL layer syntax

 

Hi to all

 

I am using PHP5-Mapscript together with Mapserver 6.0 and I have a layer
which obtains its data from a MySQL database via an OGR connection. This all
works, but I am having trouble with two items of PHP-Mapscript syntax:

 

 

1.   $layer-getExtent() - I can't make this work with my layer: can
someone confirm if it works with a MySQL layer and if so give a syntax
example?

 

 

2.   $query= $layer-queryByAttributes(null, $expression, MS_MULTIPLE); 

 

 

On the 2nd question I came across some advice from Frank Wamerdam dated 2006
which said:

 

The trick with OGR connections to pass the filter through to OGR is to use

a query expression starting with WHERE.  So you might do something like:

 

   expr = 'WHERE ' + $qField + ' = ' + $qValue

   $qLayer-queryByAttributes(null,$expr,MS_MULTIPLE);

 

(forgive my incorrect PHP syntax, I'm just trying to get the idea accross).

 

 

However I can't come up with any expression that gives me any results at
all. Is there any current advice on how to do this kind of query over an OGR
connection?

 

 

Chris

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] php-Mapscript and MySQL layer syntax

2011-06-27 Thread Chris Green
Hi to all

 

I am using PHP5-Mapscript together with Mapserver 6.0 and I have a layer
which obtains its data from a MySQL database via an OGR connection. This all
works, but I am having trouble with two items of PHP-Mapscript syntax:

 

 

1.   $layer-getExtent() - I can't make this work with my layer: can
someone confirm if it works with a MySQL layer and if so give a syntax
example?

 

 

2.   $query= $layer-queryByAttributes(null, $expression, MS_MULTIPLE); 

 

 

On the 2nd question I came across some advice from Frank Wamerdam dated 2006
which said:

 

The trick with OGR connections to pass the filter through to OGR is to use

a query expression starting with WHERE.  So you might do something like:

 

   expr = 'WHERE ' + $qField + ' = ' + $qValue

   $qLayer-queryByAttributes(null,$expr,MS_MULTIPLE);

 

(forgive my incorrect PHP syntax, I'm just trying to get the idea accross).

 

 

However I can't come up with any expression that gives me any results at
all. Is there any current advice on how to do this kind of query over an OGR
connection?

 

 

Chris

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users