<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="+1"><font face="sans-serif">I'm trying to understand how to
do querying via PHP mapscript, and I don't understand the results I'm
getting. Basically I'm querying a polygon layer of US States with a
rectangle that intersects 8 states in the upper midwest. It fully
encloses two of these. The following script seems to find only one
result and it says the shapeindex is 42. Now I know this is the answer
to the meaning of life, the universe and everything, but how do I use
this to get a list of the state names that were found (and why is it
only returning 1 found?)<br>
<br>
What I want to do eventually is display these states on the map in a
highlighting color to show they were selected. If I'm going about this
all wrong, could somebody clue me in?<br>
<br>
$rect = ms_newRectObj();<br>
$rect->setextent(-50000, -50000, 50000, 50000);<br>
$lyr = $map->getLayer(1); // states layer<br>
$results = $lyr->queryByRect($rect);<br>
if ($results == MS_FAILURE) {<br>
echo "Nothing found.<br />";<br>
} else {<br>
echo "Found " . $lyr->getNumResults()."<br />";<br>
for ($i=0; $i<$lyr->getNumResults(); $i++) {<br>
$rcache = $lyr->getResult($i);<br>
echo " shapeindex: ".$rcache->shapeindex;<br>
}<br>
}<br>
$rect->free();<br>
<br>
<br>
</font></font>
</body>
</html>