Query on Database. How can i do?

Zica Kimica mhda at TERRA.COM
Fri Jun 1 19:04:00 EDT 2007


Hello, i'm a new user on Mapserver. I'm trying to develop a website that
makes query based on selection of radio button and javascript trees like the
example below.

------------Example of a tree--------
- Crimes
  - Life Crime
     o 2006  o 2007
+ Other queries
-------------------------------------

Well, then suppose the user choose Life Crimes of 2006, now i don't know
what i have to do. Suppose there's a table in one database like:

------Example of LifeCrime's Table----
PK | STATES | YEAR | VALUE |
01 | StateA  | 2006  | 30      |
02 | StateA  | 2007  | 25      |
03 | StateB  | 2006  | 25      |
--------------------------------------

I also have a shapefile of States(POLYGON). like states.shp
I want to know how can i make states that have values of 30+ on Life Crime
appears in color red and the other in yellow.

* See that i can't make the database on the shape and use CLASSITEM and
EXPRESSION, because it's a related database and very long.

Below you see my ideas of what i have to do, but i don't know how can i do
and i also think that the best solution is different if them. Fell free to
read them and post the best solution and give opinions on my ideas.

---------------my ideas, but i don't know if is it the best
way------------------
1) I think that first i have to know what is the query. PHP gets the choosed
query(Life Crime of 2006) and then send a query to the database, then get
the results and send it to mapserver( how does it function)?

2) Mapserver just make query like this connecting to a database(in this
case, the Mapserver is doing query not the Script Language) and get values
based on regular expressions.( how?)

3) I have to insert a lot of fields on the ShapeFile Table with results of
the queries.(but this way is not up-to-date, neither cool).
----------------------------------------------------------------------------

Thanks for helping a new user!



More information about the mapserver-users mailing list