CONNECTION to database

Fawcett, David David.Fawcett at STATE.MN.US
Mon Mar 14 10:02:26 EST 2005


Another option is that if you are using something like php, asp, ColdFusion, etc.  You can use MapServer to query your .shp file and retrieve the ID for the database record.  

Then, you use php (or whatever) to dynamically build a query and display the result set.  

David.

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU]On
Behalf Of Stephen Woodbridge
Sent: Sunday, March 13, 2005 9:25 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] CONNECTION to database


Paul Ramsey wrote:
> http://www.catb.org/~esr/faqs/smart-questions.html
>
> On 13-Mar-05, at 2:56 PM, w m wrote:
>
>> w m <wokar1 at YAHOO.COM> wrote:
>>  Hi,
>> I have a .shp file layer that i created from postgres.  then i
>> inserted that .shp in my mapscript and it is of type POINT. I want
>> user to be able to click on the points and retrieve information from
>> the data base(perhaps on another webpage which would display the
>> results of the query).  I tried using the CONNECTION command but
>> nothing happend.  any clue as to where i should start........

Wokar,

There is not automatic way to do what you are trying to do. Here are the
steps that you will need to work out:

1) display yourt data as a map using mapserver and a mapfile
2) implement a query using a JOIN of a column in the shapefile to your
database to get the information you want to display and set up some
templates to display it.
3) if you want it to display in another window there is a way to do
that, but I don't remember the details, but they are irrelavant if you
can't get the above working.
4) If you haven't checked out the demo you should, because I think it
has a good example of doing a query, that would help you understand that
part.

-Steve W.



More information about the mapserver-users mailing list