1

Topic: No Guests

How would i exclude guests as a usergroup from this patch of code tongue thanks in advance.

<div class="block">
<h2><span><? echo 'Group Legend'; ?></span></h2>
<div class="box">
   <div id="groups" class="inbox">
<ul>
<li>
<?
$result = $db->query('SELECT g_id, g_title FROM '.$db_prefix.'groups ORDER BY g_id') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());

while($cur_group = $db->fetch_assoc($result))
{
    
?>

<a href="userlist.php?username=&show_group=<?php echo $cur_group['g_id']; ?>&sort_by=num_posts&sort_dir=DESC&search=Submit"><?php echo $cur_group['g_title']; ?></a> |

<?
}
?>
</li>
</ul>

   </div>
   </div>
</div>

Re: No Guests

Add a WHERE clause to the query:

$result = $db->query('SELECT g_id, g_title FROM '.$db_prefix.'groups WHERE g_id <> 3 ORDER BY g_id') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());

3

Re: No Guests

thanks alot guardian tongue much appreciated.