[mapserver-commits] r10410 - branches/branch-5-6/docs/en/mapfile

svn at osgeo.org svn at osgeo.org
Thu Jul 29 10:31:54 EDT 2010


Author: jmckenna
Date: 2010-07-29 14:31:54 +0000 (Thu, 29 Jul 2010)
New Revision: 10410

Modified:
   branches/branch-5-6/docs/en/mapfile/join.txt
Log:
minor changes to document mysql connection (ticket:3135)

Modified: branches/branch-5-6/docs/en/mapfile/join.txt
===================================================================
--- branches/branch-5-6/docs/en/mapfile/join.txt	2010-07-28 18:53:03 UTC (rev 10409)
+++ branches/branch-5-6/docs/en/mapfile/join.txt	2010-07-29 14:31:54 UTC (rev 10410)
@@ -27,23 +27,37 @@
 
 CONNECTION [string]
     Parameters required for the join table's database connection (not required
-    for DBF or CSV joins). The following is an example for :ref:`PostgreSQL
+    for DBF or CSV joins). The following is an example connection for :ref:`PostgreSQL
     <input_postgis>`:
 
-.. code-block:: mapfile
+    .. code-block:: mapfile
 
-    CONNECTION "host=127.0.0.1 port=5432 user=postgres password=postgres dbname=somename"
+      CONNECTION "host=127.0.0.1 port=5432 user=postgres password=postgres dbname=somename"
+      CONNECTIONTYPE OGR
+    
+    The following is an example connection for MySQL:
+    
+    .. code-block:: mapfile
+      
+      CONNECTION "MYSQL:mydbname,user=root,password=mysql,port=3306"
+      CONNECTIONTYPE OGR
 
 CONNECTIONTYPE [string]
-    Type of connection (not required for DBF or CSV joins). The following is
-    an example for PostgreSQL:
+    Type of connection (not required for DBF or CSV joins). For PostgreSQL and
+    MySQL connections use 'OGR'.
+    
+FOOTER [filename]
+    Template to use *after* a layer's set of results have been sent. In other
+    words, this header HTML will be displayed after the contents of the 
+    `TEMPLATE` HTML.
 
-.. code-block:: mapfile
-
-    CONNECTIONTYPE ogr 
-
 FROM [item]
     Join item in the dataset.  This is case sensitive.
+    
+HEADER [filename]
+    Template to use *before* a layer's set of results have been sent. In other
+    words, this header HTML will be displayed before the contents of the 
+    `TEMPLATE` HTML.
 
 NAME [string]
     Unique name for this join. Required.  
@@ -277,4 +291,68 @@
 
 ::
 
-  <tr bgcolor="#EFEFEF"><td align="left">[NAME]</td><td align="left">[test_VAL]</td></tr>
\ No newline at end of file
+  <tr bgcolor="#EFEFEF"><td align="left">[NAME]</td><td align="left">[test_VAL]</td></tr>
+  
+Example 4: Join from SHP file to MySQL table
+============================================
+
+Mapfile Layer
+-------------
+
+.. code-block:: mapfile
+
+      LAYER
+        NAME "prov_bound"
+        TYPE POLYGON
+        STATUS DEFAULT
+        DATA "prov.shp"
+        CLASS
+          NAME "Province"
+          STYLE
+            OUTLINECOLOR 120 120 120
+            COLOR 255 255 0
+          END
+        END
+        TOLERANCE 20
+        TEMPLATE "../htdocs/cgi-query-templates/prov.html"
+        HEADER "../htdocs/cgi-query-templates/prov-header.html"
+        FOOTER "../htdocs/cgi-query-templates/footer.html"  
+        JOIN
+          NAME "test"
+          CONNECTION "MYSQL:test,user=root,password=mysql,port=3306"
+          CONNECTIONTYPE ogr
+          TABLE "lookup"
+          FROM "ID"
+          TO "ident"
+          TYPE ONE-TO-ONE
+        END
+      END # layer
+
+Ogrinfo
+-------
+
+::
+
+  >ogrinfo MYSQL:test,user=root,password=mysql,port=3306 lookup -summary
+      INFO: Open of `MYSQL:test,user=root,password=mysql,port=3306'
+      using driver `MySQL' successful.
+
+     Layer name: lookup
+     Geometry: None
+     Feature Count: 48
+     Layer SRS WKT:
+     (unknown)
+     FID Column = ident
+     val: Integer (0.0)
+
+Template
+--------
+
+::
+
+  <tr bgcolor="#EFEFEF"><td align="left">[NAME]</td><td align="left">[test_val]</td></tr>
+
+.. note::
+
+    When testing with MapServer 5.6.5 and MySQL 5.1.49 on Windows this MySQL join caused a
+    mapserv.exe crash.
\ No newline at end of file



More information about the mapserver-commits mailing list