Skip to content
Snippets Groups Projects
Commit 720fa685 authored by Robert Anderson's avatar Robert Anderson
Browse files

Fixed up function a little, untested

parent a4eccf3b
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,8 @@ include_once("include/db.php"); ...@@ -7,6 +7,8 @@ include_once("include/db.php");
function getAdminUserGroups($params) { function getAdminUserGroups($params) {
global $db; global $db;
$i = 0;
# Filters and sorts are the same here # Filters and sorts are the same here
$filtersorts = array( $filtersorts = array(
'ID' => 'users_to_groups.GroupID', 'ID' => 'users_to_groups.GroupID',
...@@ -17,6 +19,9 @@ function getAdminUserGroups($params) { ...@@ -17,6 +19,9 @@ function getAdminUserGroups($params) {
$res = DBDo("SELECT GroupID FROM users_to_groups WHERE UserID = ?",$params[0]); $res = DBDo("SELECT GroupID FROM users_to_groups WHERE UserID = ?",$params[0]);
if ($res !== FALSE) { if ($res !== FALSE) {
while ($row = $res->fetchObject()) { while ($row = $res->fetchObject()) {
$i++;
$item = array(); $item = array();
$item['ID'] = $row->groupid; $item['ID'] = $row->groupid;
...@@ -36,18 +41,7 @@ function getAdminUserGroups($params) { ...@@ -36,18 +41,7 @@ function getAdminUserGroups($params) {
return $res; return $res;
} }
# loop through rows return array($resultArray,$i);
while ($row = $sth->fetchObject()) {
$item = array();
$item['ID'] = $row->groupid;
$item['Name'] = $row->name;
# push this row onto array
array_push($resultArray,$item);
}
return array($resultArray,$numResults);
} }
?> ?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment