Skip to content

Instantly share code, notes, and snippets.

@vgrish
Last active January 13, 2016 11:00
Show Gist options
  • Save vgrish/74061049103ce38bc9fb to your computer and use it in GitHub Desktop.
Save vgrish/74061049103ce38bc9fb to your computer and use it in GitHub Desktop.
<?php
$id =1;
$q = $modx->newQuery('modUserGroupMember', array('member' => $id));
$q->leftJoin('modUserGroup', 'modUserGroup', 'modUserGroup.id = modUserGroupMember.user_group');
$q->select('modUserGroupMember.user_group,modUserGroup.name');
$q->sortby('modUserGroupMember.user_group');
if ($q->prepare() && $q->stmt->execute()) {
$row = $q->stmt->fetch(PDO::FETCH_ASSOC);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment