[mapserver-users] looking for samples for using php with mapServer

Daniel Morissette morissette at dmsolutions.ca
Wed Jul 25 09:46:33 EDT 2001


Speh Sylvain wrote:
> 
> We have non-geographical datas which are stored in a DBRM, with an ODBC
> driver. We can access and
> display them with a short PHP script.
> 
> As PHP can't be run just after the mapServer's one in the same CGI access to
> the server, we are looking for short mapScript samples which are displaying
> DBRM datas according to the clicked polygon-ID. polygon-ID is the primary
> key in our DB.
> 

Sylvain,

I would love to see some users sharing examples of this type. 
Integrating maps and RDBMS tables is something lots of users try to do
and every time we have to explain the process again since none of those
who have got this running have shared apps yet.  (We're not better...
the apps we have that do this we cannot share either!  :(

OK, back to your specific case: you mention that you already have the
PHP code to access the attributes for a given polygon-ID and display
them, so you're not too far from a solution.

If you look at GMapDumpQueryResults() in gmap75.php3 in our GMap PHP
sample app and replace the dbase_...() calls with MySQL calls then you
should have exactly what you need.  The shapeid obtained from the result
object is the polygon-id that you need to access your RDBMS tables.

Make sure you look at the version of the GMap scripts demo that matches
the version of MapServer that you're using (3.4 or 3.5) since the
query-related stuff (and hence GMapDumpQueryResults()) have changed
between 3.4 and 3.5.

-- 
------------------------------------------------------------
 Daniel Morissette               morissette at dmsolutions.ca
 DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------
  Don't put for tomorrow what you can do today, because if 
      you enjoy it today you can do it again tomorrow.




More information about the mapserver-users mailing list