<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><div>queryByAttributes is not as predictable as I think is useful.&nbsp; It's usually better to set the filter and the query by the extents of the data.<br><br>So (in complete psuedo code):<br><br>layer.setFilter("(($field1 == $userv1) or ($fields2 == $userv2))")<br>layer.queryByRect(map.extent)<br><br>Then iterate through the results set.&nbsp; The problem with queryByAttributes and using the filter is that the syntax changes depending on whether or not the datasource is a database or a shapefile as MapServer does not "virtualize" the Filter settings.<br></div><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size:
 12pt;"><font size="2" face="Tahoma"><b><span style="font-weight: bold;">From:</span></b> FRANZ OKYERE &lt;franzzoa@hotmail.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> geomoose-users@lists.sourceforge.net<br><b><span style="font-weight: bold;">Sent:</span></b> Sunday, September 20, 2009 12:03:24 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Geomoose-users] Help with querybyAttribute function! Help<br></font><br>


<style><!--
.hmmessage P
{
margin:0px;padding:0px;}
body.hmmessage
{
font-size:10pt;font-family:Verdana;}
--></style>
Sorry about that. Its like this. ...some code... $querystring="(($field1=$userv1) or ($field2=$userv2))";&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$queryLayer-&gt;querybyattributes($ques, $querystring,MS_MULTIPLE);&nbsp;&nbsp;$ques is one of my attributes and field and userv in the expression are replaced with the attribute and a user supplied string. When will the method, why the errors? I hope it helps. Cheers Brent. <br><br>&gt; Date: Sat, 19 Sep 2009 19:47:16 -0600<br>&gt; Subject: Re: [Geomoose-users] Help with querybyAttribute function! Help<br>&gt; From: bfraser@geoanalytic.com<br>&gt; To: franzzoa@hotmail.com<br>&gt; CC: geomoose-users@lists.sourceforge.net<br>&gt; <br>&gt; Franz,<br>&gt; <br>&gt;   Did attach your sample?<br>&gt; <br>&gt; Brent<br>&gt; <br>&gt; &gt;<br>&gt; &gt; Dear all,<br>&gt; &gt;<br>&gt; &gt; I have done comprehensive search and reading on how to use the<br>&gt; &gt; querybyAttributes php mapscript function to evaluate a logical
 expression.<br>&gt; &gt; It looks to me no one seems to find a solution to the errors that  come<br>&gt; &gt; up. The problem is that there are so many suggestions on the syntax.<br>&gt; &gt; Please, please, can someone do all of us a favour and explain to us what<br>&gt; &gt; exactly is the right and working way to use the querybyAttribute (I am<br>&gt; &gt; using GM 2- does it matter). Here is a sample of how I am using it and I<br>&gt; &gt; have tried a thousand different combinations of code. Please what is wrong<br>&gt; &gt; so we (the geomoose users) can move on.<br>&gt; &gt;<br>&gt; &gt; Thanks a million.<br>&gt; &gt;<br>&gt; &gt; Franz Okyere<br>&gt; &gt;<br>&gt; &gt; Lecturer/GIS Specialist<br>&gt; &gt;<br>&gt; &gt; _________________________________________________________________<br>&gt; &gt; Get the best of MSN on your mobile<br><span>&gt; &gt; <a target="_blank"
 href="http://clk.atdmt.com/UKM/go/147991039/direct/01/">http://clk.atdmt.com/UKM/go/147991039/direct/01/</a></span><br>&gt; &gt; ------------------------------------------------------------------------------<br>&gt; &gt; Come build with us! The BlackBerry&amp;reg; Developer Conference in SF, CA<br>&gt; &gt; is the only developer event you need to attend this year. Jumpstart your<br>&gt; &gt; developing skills, take BlackBerry mobile applications to market and stay<br>&gt; &gt; ahead of the curve. Join us from November 9&amp;#45;12, 2009. Register<br>&gt; &gt; now&amp;#33;<br><span>&gt; &gt; <a target="_blank" href="http://p.sf.net/sfu/devconf">http://p.sf.net/sfu/devconf</a></span><br>&gt; &gt; _______________________________________________<br>&gt; &gt; Geomoose-users mailing list<br>&gt; &gt; Geomoose-users@lists.sourceforge.net<br><span>&gt; &gt; <a target="_blank"
 href="https://lists.sourceforge.net/lists/listinfo/geomoose-users">https://lists.sourceforge.net/lists/listinfo/geomoose-users</a></span><br>&gt; &gt;<br>&gt; &gt;<br>&gt; <br>&gt; <br>                                               <br><hr>Beyond Hotmail - see what else you can do with Windows Live. <a rel="nofollow" target="_blank" href="http://clk.atdmt.com/UKM/go/134665375/direct/01/">Find out more.</a></div></div></blockquote></div><br>

      </body></html>