php3 and Point Query
Daniel Morissette
morissette at dmsolutions.on.ca
Thu Oct 12 08:54:03 PDT 2000
peter.jacobs at javel.nl wrote:
>
> Hello,
> though I have read most of the previous mesages I'am not able to get a
> point query working. Can someone help me?
> -----------------------------------------------
> ERROR message :
> Points : 84463.618126601 447332.90091818
> Warning: Using scalar variable $result as an array or object in test.php on
> line 225
This PHP error means that $result is not a valid queryResultObj.
The MapScript documentation should say that if nothing was found at
query location then queryUsingpoint() returns 0. So your code should
check for that case:
$result =$layer->queryusingpoint($point,MS_SINGLE,-1);
if ( ! $result )
{
echo "Nothing found at click location";
}
else
{
echo("Result :$result->numresults"); //error!
$shapendx = $queryres->next();
...
}
--
------------------------------------------------------------
Daniel Morissette morissette at dmsolutions.on.ca
http://www.dmsolutions.on.ca/
------------------------------------------------------------
Don't put for tomorrow what you can do today, because if
you enjoy it today you can do it again tomorrow.
More information about the MapServer-users
mailing list