AW: [Mapserver-users] PHP/Mapscript - Mapserver 4.0 - $oLayer->queryByAttributes()

Alexander Gabriel alexander.gabriel at blubbermania.com
Fri Oct 31 04:22:22 EST 2003


Hello,

thx for your reply.
i've tried

[code]
$query = '([GEMARKUNG] = 7725 AND [FLUR] = 0 AND \'[FLSTNR]\' = \'3000\')';
@$myLayer->queryByAttributes("", $query, MS_MULTIPLE);
[/code]

But it didn't work :(


-----Ursprungliche Nachricht-----
Von: Daniel Morissette [mailto:morissette at dmsolutions.ca]
Gesendet: Donnerstag, 30. Oktober 2003 20:20
An: Alexander Gabriel
Cc: mapserver-users at lists.gis.umn.edu
Betreff: Re: [Mapserver-users] PHP/Mapscript - Mapserver 4.0 -
$oLayer->queryByAttributes()


Have you tried the following?  If you use a logical expression then it
is quite likely that the qitem argument is ignored:

[code]
$query = "('[".$Field1Name."]' = '".$Field1Value."' AND
[".$Field2Name."] = ".$Field2Value.")";
@$myLayer->queryByAttributes("", $query, MS_MULTIPLE);
[/code]



Alexander Gabriel wrote:
> Hi there,
>
> i've just updated from Mapserver 3.6 to Mapserver 4.0 and have a question
on
> $oLayer->queryByAttributes();.
> In PHP/Mapscript from Mapserver3.6 i used to do this:
>
> [code]
> $query = "('[".$Field1Name."]' = '".$Field1Value."' AND [".$Field2Name."]
=
> ".$Field2Value.")";
> $oLayer->setFilter($query);
> @$myLayer->queryByAttributes(MS_MULTIPLE);
> [/code]
>
> an it worked, if i zoomed to the extent of the Building via opening the
> Shapefile and getting the Extents of the Shape.
>
> Now, the syntax of queryByAttributs is "int queryByAttributes(string
qitem,
> string qstring, int mode)".
> But what if i want to find Shapes by more than one item?
> I've tried
> [code]
> $oLayer->queryByAttributes(array("Field1", "Field2"), array("Value1",
> "Value2"), MS_MULTIPLE);
> [/code]
>
> [code]
> $oLayer->queryByAttributes("Field1, Field2", "Value1 Value2",
MS_MULTIPLE);
> [/code]
>
> and
> [code]
> $oLayer->queryByAttributes("Field1", "Value1", MS_MULTIPLE);
> $oLayer->queryByAttributes("Field2", "Value2", MS_MULTIPLE);
> [/code]
>
> But nothing works :(
>
> Can anyone please help me?
>
> Thx
> Alexander Gabriel
>




More information about the mapserver-users mailing list