<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1170" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Christian,</FONT></DIV>
<DIV> </DIV>
<DIV>where do you perform de query in the mapscript script???</DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>>I am 
using     </FONT></DIV>
<DIV><FONT face=Arial size=2>>$my_layer = 
$map->getlayerbyname(ptmesure);</FONT></DIV>
<DIV><FONT face=Arial size=2>Here you must include something like </FONT></DIV>
<DIV> </DIV>
<DIV>$my_layer->queryByPoint($my_point,MS_MULTIPLE,0) </DIV>
<DIV> </DIV>
<DIV>OR </DIV>
<DIV> </DIV>
<DIV>
<DIV>$my_layer->queryByRect($my_rect) </DIV></DIV>
<DIV><FONT face=Arial size=2><BR>>$numResults = 
$my_layer->getNumResults();</FONT></DIV>
<DIV><FONT face=Arial size=2>>but the query result is always 0.</FONT></DIV>
<DIV> </DIV>
<DIV>Regards</DIV>
<DIV>Oscar</DIV></FONT></DIV>
<BLOCKQUOTE dir=ltr 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=christian.blumer@epfl.ch 
  href="mailto:christian.blumer@epfl.ch">Christian Blumer</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Cc:</B> <A 
  title=mapserver-users@lists.gis.umn.edu 
  href="mailto:mapserver-users@lists.gis.umn.edu">mapserver-users@lists.gis.umn.edu</A> 
  </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, June 27, 2003 10:10 
AM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [Mapserver-users] Query postgis 
  layer</DIV>
  <DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT><BR></DIV>
  <DIV><FONT face=Arial size=2>Hi all</FONT></DIV>
  <DIV><FONT face=Arial size=2>I would like to make a query on a layer connected 
  to postgis with PHP mapscript.</FONT></DIV>
  <DIV><FONT face=Arial size=2>The layer definition is:</FONT></DIV>
  <DIV><FONT face=Arial size=2>LAYER<BR>  NAME ptmesure<BR>  STATUS 
  off<BR>  TYPE POINT<BR>  CONNECTIONTYPE postgis<BR>  CONNECTION 
  "user=xxx password=xxx dbname=test host=xxx"<BR>  DATA "the_geom from 
  (select * from mesure) as foo using unique gid using SRID=-1"<BR>  
  CLASS<BR>    NAME "gps"<BR>    COLOR 220 0 
  0<BR>    SYMBOL 'circle'<BR>    SIZE 
  7<BR>    TEMPLATE "mesure.html"<BR>  END <BR>  HEADER 
  "mesure_header.html"<BR>  FOOTER "mesure_footer.html"<BR>  TOLERANCE 
  10 <BR>END</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>I am 
  using     </FONT></DIV>
  <DIV><FONT face=Arial size=2>$my_layer = 
  $map->getlayerbyname(ptmesure);<BR>$numResults = 
  $my_layer->getNumResults();</FONT></DIV>
  <DIV><FONT face=Arial size=2>but the query result is always 0.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT> </DIV>
  <DIV><FONT face=Arial size=2>I tested is on the same layer but in shape format 
  and it worked.</FONT></DIV>
  <DIV><FONT face=Arial size=2>What should I do to make it work properly on a 
  postgis layer?</FONT></DIV>
  <DIV><FONT face=Arial size=2>Cheers,</FONT></DIV>
  <DIV><FONT face=Arial size=2>Christian</FONT></DIV></BLOCKQUOTE></BODY></HTML>