[Mapserver-users] query a postgis table with php map script

Pascal Lavorel pascal at artelabs.ch
Fri Jul 16 04:20:52 EDT 2004


hello,
there is my code:

$check=@$my_layer->queryByPoint($my_point, MS_SINGLE, 200);
if($check == MS_FAILURE){
echo "<font size=4 color=red>There were no results</font>";
}else if( $check == MS_SUCCESS){
$result = $my_layer->getResult(0);
$my_layer->open();
$shape = $my_layer->getShape($result->shapeindex,$result->tileindex);
//$result =  $my_layer->getResult(0); //not sure i must put this line
$value=$shape->values["gid"];
$my_layer->close;
}
echo $value;

when i click on my points i get "MS_SUCCESS". But i always get 1 as gid 
no matter which point i click on (but i am sure the data come from my 
database)

I must be wrong somewere!
any idea?

thanks
Pascal




More information about the mapserver-users mailing list