[postgis-users] multiple queries in one phpscript?

Charles Galpin cgalpin at lhsw.com
Thu Oct 6 05:01:24 PDT 2011


On Oct 6, 2011, at 5:11 AM, Robert Buckley wrote:

> If I have multiple charts which use mulitple queries, am I able to put them in one php script or do I need a seperate script for each query?
> 
> Please excuse me if this should not be posted here...but I consider this more of a postgis/webmapping question as a sencha/extjs question.

It's really a client side question, but I'll try explain.   If you currently get data for your charts using 

chart1.php
chart2.php
...

and you are looking to consolidate and share code you can create one script with all the same common code that takes an argument to change the sql query for each chart. You'd then call it with  

chart.php?type=1
chart.php?type=2 

In your php you'd look at the type and modify the sql string used in the query. If the results/columns differ from the queries you'll need further logic to handle them differently by type.

hth
charles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20111006/de156071/attachment.html>


More information about the postgis-users mailing list