[Mapserver-users] JOIN problems

BONNER S KARGER bskarger at students.wisc.edu
Tue Jul 13 12:07:55 EDT 2004


List, 

I am trying to use JOIN in my LAYER object to get more attribute info from a MySQL table. I have a point layer shapefile called "waste1" in the data directory. There is a field called PRDUCER_ID. The MySQL table I want to join is in the DB called "BYPRODUCTS3". The table name is "PRODUCER". The field name I want to use as the key in the table is called "PRODUCER_ID".

Browsing the map is no problem, but when I click the query option, then click a point from this layer, I get the following error:

Content-type: text/html msMySQLJoinConnect(): DBASE file error. Item PRDUCER_ID not found in table waste1. 
msMySQLQuery(): Query error. Bad mysql query (SELECT count(PRDUCER_ID) FROM waste1)

What is going on? It seems like there is no place in the JOIN object to tell mapserver what db table to use...only which .dbf table to use.

Below is the layer def. from my map file:

LAYER
  NAME waste1
  TYPE POINT
  STATUS ON
  DATA waste1
	
  CLASS   
    NAME "Meat Proc. Residuals"
		TEMPLATE "test.html"
		COLOR 255 051 000
    SYMBOL "circle"
    SIZE 8
  END
	
	TOLERANCE 5

	DUMP TRUE # allow GML export
	
	JOIN
    CONNECTIONTYPE mysql
    CONNECTION "server:user:pass:BYPRODUCTS3"
     NAME "MeatProcJoin"
		 TABLE waste1
		 FROM PRODUCER_ID
     TO PRDUCER_ID
		 TYPE SINGLE
   END
END 



This is mapserver 4.2, on Linux.

Any ideas?
Thanks
Bonner






More information about the mapserver-users mailing list