[Mapserver-users] why --> msQueryByAttributes(): Query error. No query expressiondefined

David Fawcett David.Fawcett at state.mn.us
Tue Jul 6 10:58:11 EDT 2004


I may be mistaken, but the example looks a little old.  What version of
MapServer are you using?  

David.

David J. Fawcett
MN Office of Environmental Assistance

>>> Javier Castillejo Montes <jcastil1 at tragsa.es> 7/6/2004 8:00:55 AM
>>>
Hi all,
 

Does anyone know why this code has an error. I'm just trying to use a
mapserver example  from the internet, I copied the code made the
changes
necesaries and... ERROR!!!! :-(
 

### ERROR:  
  msQueryByAttributes(): Query error. No query expression defined.
 
### main html
 

<html>
<body>
<form name="mapserv" method="get"
action="//[host]/scripts/mapserv.exe">
<input type="text" name="mapserv" value="//[host]/scripts/mapserv.exe"
size=100%>
<input type="text" name="map" value="[path]/map/case1.map" size=100%>
<input type="text" name="map_web_imagepath" value="[path]/tmp/" 
size=100%>
<input type="text" name="map_web_imageurl" value="[path]/tmp/">
<input type="text" name="mode" value="itemquery"  size=100%>
<input type="text" name="qlayer" value="provin"  size=100%>
 
<br><br><br><br><br><br>
Select
 
<input type="text" name="name" id="name" value="mad">
 
<br>
 
<input type="submit" value="Go!">
 
</form>
</body>
</html>
 

## map file
 
MAP
  NAME case1
  SHAPEPATH      "../data"
  SIZE 300 300
  EXTENT -50000 4000000 1100000 4800000
 
  WEB
    IMAGEPATH '../data/tmp/'
    IMAGEURL  '../data/tmp/'
  END
 
  QUERYMAP
    STATUS ON
    STYLE HILITE
    COLOR 255 255 0
  END
 
  LAYER
    NAME provin
    DATA provin
    STATUS DEFAULT
    TYPE POLYGON
    FILTERITEM nombre
    FILTER "%name%"
    CLASS
      COLOR 212 212 212
      OUTLINECOLOR 0 0 0
      TEMPLATE "../html/case1_template.html"
    END
  END
 
END
 

### template file
 
<html>
<head>
  <title>MapServer Test Suite - ItemQuery</title>
</head>
 
<body bgcolor="#ffffff">
 
<font size="+2" face="arial,helvetica"><b>Case 1: Simple ItemQuery
With
QueryMap</b></font>
 
<p>
 
This is just a simple dump of a few attributes for an individual
polygon
in the test suites counties layer:
 
<p>
 
<b>Name:</b> [Name]<br>
<b>ID Provincia:</b> [prov]<br>
<b>Comunidad Code:</b> [Comunidadc]<br>
 
<p>
 
and here's the map of the query results (you can zoom to a set of
results as
well):
 
<p>
 
<table cellpadding="5">
<tr>
<td><img border="2" src="[img]" height="300" width="300"></td>
<td><img border="2"
src="[mapserv]?map=[map]&name=[name_esc]&mode=itemquerymap&mapext=shapes&qla
yer=[qlayer]" height="300" width="300"></td>
</tr>
</table>
 
</body>
</html>
 
 
thanks in advance



More information about the mapserver-users mailing list