Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP mapscript : Can't use queryByIndex result #4926

fabien-cat opened this issue May 15, 2014 · 3 comments

PHP mapscript : Can't use queryByIndex result #4926

fabien-cat opened this issue May 15, 2014 · 3 comments


Copy link

fabien-cat commented May 15, 2014


I can't use queryByIndex result on Postgis layers (Mapserver 6.4.1, PHP 5.5.12, Postgis 2.0).
$aQueryIndex=new array(2211, 2215);
foreach($aQueryIndex as $iIndex){

    echo $oLayer->getNumResults();  // return 2, it's OK

     for ($i=0; $i<$oLayer->getNumResults(); $i++){
        echo $oShape->index; // return always 2215, the last one

I've a second problem if I do :

    echo $oLayer->getNumResults();  // return 3 instead of 2

If I do a savequery(), the getNumResults() is always increases 1.

I see that issue :
Indeed, the getNumresults() function works but the result can't be use.

In version 5.4 of Mapserver everything works fine.

I looked the code (mapquery.c), this is complex, maybe there is a problem with the result index ?!


Fabien Marty

mkofahl added a commit to faegi/mapserver that referenced this issue May 28, 2014
Copy link

mkofahl commented May 28, 2014

Thank you, @fabien-cat. With postgis, the result index is always 0, which is the row number. See #4932 for further explanation.

Copy link

fabien-cat commented Jul 1, 2014

Thanks @mkofahl , so why there's a good number result but always the same index for Shapes result ?
There's a problem with the function msQueryByIndex() or addResult() ?

mkofahl added a commit that referenced this issue Sep 2, 2014
Copy link

mapserver-bot commented Feb 23, 2016

This is an automated comment

This issue has been closed due to lack of activity. This doesn't mean the issue is invalid, it simply got no attention within the last year. Please reopen with missing/relevant information if still valid.

Typically, issues fall in this state for one of the following reasons:

  • Hard, impossible or not enough information to reproduce
  • Missing test case
  • Lack of a champion with interest and/or funding to address the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

3 participants