| Re: need help with sql: retreiving a list of users in a group |
| by iHackCode on 2007/3/7 23:36:04 That sounds like a good idea. Thanks. |
| Re: need help with sql: retreiving a list of users in a group |
| by phppp on 2007/3/7 22:20:53 It is not always necessary to use the member handler Build your own handler if you have much applications with XOOPS users |
| need help with sql: retreiving a list of users in a group |
| by iHackCode on 2007/3/7 22:13:10 this is the sql statement i want.. le="color: #000000"><?php SELECT * FROM `xoops2_users` JOIN xoops2_groups_users_link ON xoops2_users.uid = xoops2_groups_users_link.uid WHERE xoops2_groups_users_link.groupid = '2' AND user_mailok >= '0' AND level > '0' MyCode: le="color: #000000"><?php $criteria = new CriteriaCompo(); ~~~~~~ if ( !empty($_POST['by_group']) && is_numeric($_POST['by_group']) ) { $criteria->add(new Criteria('JOIN xoops2_groups_users_link ON xoops2_users.uid = xoops2_groups_users_link.uid WHERE xoops2_groups_users_link.groupid', intval($_POST['by_group']), '=','')); } $member_handler =& xoops_gethandler('member'); $total = $member_handler->getUserCount($criteria); ~~ $foundusers =& $member_handler->getUsers($criteria, true); $total and $foundusers are not working since they both using method that are using the renderWhere() method from the criteria (CriteriaCompo class).. but.. using the render() method will not work either since it also adds parentheses.. .example.. le="color: #000000"><?php SELECT *FROM `xoops2_users` WHERE (JOIN xoops2_groups_users_link ON xoops2_users.uid = xoops2_groups_users_link.uid WHERE xoops2_groups_users_link.groupid = '2' AND user_mailok >= '0' AND level > '0') anyone got any ideas on how to make it work?! or a different way to make it work?! |