Currently, if you pass this function a SELECT that produces a two-column result, it gives you back an associative array with entries col_1 => col_2.
I want to change this so that if your select produces a one-column result, you get an array that is basically a list of those values.
The change is around line 940 or datalib.php which currently looks like:
if ( $rs->RecordCount() > 0 ) {and my proposal changes it to
while (!$rs->EOF) {
$menu[$rs->fields[0]] = $rs->fields[1];
$rs->MoveNext();
}
return $menu;
} else {
return false;
}
if ( $rs->RecordCount() > 0 ) {that is, an if statement for the special case of one column, and also changing to using the library routines, rather than manually doing a while loop.
if ($rs->NumCols() == 1) {
return $rs->GetArray();
} else {
return $rs->GetAssoc(false, true);
}
} else {
return false;
}
Comments?
Thanks,
Tim.
P.S. the attached patch makes this change, and also updates all the necessary comments.