Jump to content

Recommended Posts

  • Administrators
Posted

$users = UserGroups::GetUsersInGroup ([group id);

Replace [group id] with the ID of the group, and it will return an array of all the users in it

  • Administrators
Posted

Well, you have to do something with it:

// After that


foreach($users as $pilot)
{
    echo "The pilot is {$pilot->firstname} {$pilot->lastname}<br />";
}

Posted

<table width="940" border="0" align="center" cellpadding="1" cellspacing="0" style="background-color:white;border:1px dashed black;">
  <tr>
    <td><div align="center">On completion of this Operation, all crew members stated below will be able to place the "<strong>Operation Herrick 11</strong>" medal on there Forum Signatures.</div></td>
  </tr>
</table>
<table width="940" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="470"><h2>Alpha Crew</h2>
    <?php $users = UserGroups::GetUsersInGroup (16);?>
<?php foreach($users as $pilot)
{
    echo "The pilot is {$pilot->firstname} {$pilot->lastname}";
} ?></td><td><h2>Bravo Crew</h2></td>
  </tr>
</table>

This is the coding on the page and it is bringing back

Warning: Invalid argument supplied for foreach() in /####/####/public_html/core/pages/operation######.htm on line 10

.

If anyone can help  :D

  • Administrators
Posted

Then either the group ID is wrong or there's no users in the group

You can do:

if(!$users) { echo 'There are no pilots in this group'; $users=array(); }
// Before this line
foreach($users as $pilot)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...