multiple field query

Blaise bpicinbono at WORLDONLINE.FR
Mon Jul 17 16:38:53 EDT 2006


hi there
I've searched a bit in the archives but I can't figure it out.
I am able to query an single field of a dbf table this way :

$amteacarf=42;
$qLayer=$zeMap->getLayerByName("metacarflink");
$result=@$qLayer->queryByAttributes("METACARF",$ametacarf,MS_MULTIPLE);
$res_count = $qLayer->getnumresults();

Now I would like to query a layer for (one field = something) OR (another 
field = something)
I tryed this way :

$qLayer=$zeMap->getLayerByName("tron");
$qstring="([CARF_T]=$acarf OR '[CARF_A]'=$acarf)" ;
$result=@$qLayer->queryByAttributes('CARF_T',$qstring,MS_MULTIPLE);
$res_count = $qLayer->getnumresults();

I tryed different syntaxes but I am a bit lost with single and double quote 
and the right syntax.
For now, I am stuck with processing a double query, which might be more time 
consuming.
Anyone can help, please ?
Thanks
Blaise



More information about the mapserver-users mailing list