Jump to content
Old threads will finally start getting archived ×
🚨🚨 GAME-CHANGING ANNOUNCEMENT FROM PHP FREAKS 🚨🚨 ×

Recommended Posts

Ok, I have no idea how I can do this so I am hoping you can point me in the right direction. In my database I have a line in my users table called admin. In this 0 means they are a normal user, and 1 means they are an admin. Is there any way to edit my code posted below to show only normal users, I want it to show only ones with 0 in the admin line, then I need to be able to show only admins, so only people with a 1 in the admin line.

 

This code displays all of my users:

 

    <tr><td class="contenthead">.: List of students registered</td></tr>
    <tr><td class="contentcontent">
<table width='100%'>
<tr>

<td>Name</td>


<td align='center'>Online</td>
</tr>
<?
$view = ($_GET['view'] != "") ? $_GET['view'] : 'admin';


$result = mysql_query("SELECT * FROM `grpgusers` ORDER BY `".$view."` DESC LIMIT 500");
$rank = 0;
while($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$rank++;
$user_hall = new User($line['id']);
?>
<tr>

		<td><?= $user_hall->formattedname ?></td>
		<td><?= $user_hall->formattedonline ?></td>
</tr>
<?
}
?>

</td></tr>

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.