<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. 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. 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 <franzzoa@hotmail.com><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))"; $queryLayer->querybyattributes($ques, $querystring,MS_MULTIPLE); $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>> Date: Sat, 19 Sep 2009 19:47:16 -0600<br>> Subject: Re: [Geomoose-users] Help with querybyAttribute function! Help<br>> From: bfraser@geoanalytic.com<br>> To: franzzoa@hotmail.com<br>> CC: geomoose-users@lists.sourceforge.net<br>> <br>> Franz,<br>> <br>> Did attach your sample?<br>> <br>> Brent<br>> <br>> ><br>> > Dear all,<br>> ><br>> > I have done comprehensive search and reading on how to use the<br>> > querybyAttributes php mapscript function to evaluate a logical
expression.<br>> > It looks to me no one seems to find a solution to the errors that come<br>> > up. The problem is that there are so many suggestions on the syntax.<br>> > Please, please, can someone do all of us a favour and explain to us what<br>> > exactly is the right and working way to use the querybyAttribute (I am<br>> > using GM 2- does it matter). Here is a sample of how I am using it and I<br>> > have tried a thousand different combinations of code. Please what is wrong<br>> > so we (the geomoose users) can move on.<br>> ><br>> > Thanks a million.<br>> ><br>> > Franz Okyere<br>> ><br>> > Lecturer/GIS Specialist<br>> ><br>> > _________________________________________________________________<br>> > Get the best of MSN on your mobile<br><span>> > <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>> > ------------------------------------------------------------------------------<br>> > Come build with us! The BlackBerry&reg; Developer Conference in SF, CA<br>> > is the only developer event you need to attend this year. Jumpstart your<br>> > developing skills, take BlackBerry mobile applications to market and stay<br>> > ahead of the curve. Join us from November 9&#45;12, 2009. Register<br>> > now&#33;<br><span>> > <a target="_blank" href="http://p.sf.net/sfu/devconf">http://p.sf.net/sfu/devconf</a></span><br>> > _______________________________________________<br>> > Geomoose-users mailing list<br>> > Geomoose-users@lists.sourceforge.net<br><span>> > <a target="_blank"
href="https://lists.sourceforge.net/lists/listinfo/geomoose-users">https://lists.sourceforge.net/lists/listinfo/geomoose-users</a></span><br>> ><br>> ><br>> <br>> <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>