Skip to content

Commit

Permalink
Always return number of elements in a list in a group ("grouping_num_…
Browse files Browse the repository at this point in the history
…results"), even if "limit" is not specified.
  • Loading branch information
arnemorken committed Nov 17, 2023
1 parent cbc2e4f commit 6c0828e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions data/mysql/anyTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,20 @@ protected function dbExecListStmt(&$data,$gid=null,$limit="")
//elog("num_res:".$this->mNumResults);
}
} // if
else {
// Report back number of elements in groups
if (!$gid || $gid == "")
$gr_idx = "nogroup";
else
if (isInteger($gid))
$gr_idx = intval($gid);
else
$gr_idx = $gid;
if (array_key_exists($gr_idx,$data)) {
$n = sizeof($data[$gr_idx]);
$data[$gr_idx]["grouping_num_results"] = $n;
}
}
return $success;
} // dbExecListStmt

Expand Down

0 comments on commit 6c0828e

Please sign in to comment.