0

Hello,
I need to make an script that displays word "admin" or "regular member" etc below an username.e.g.If a member is admin it displays
"admin" below his username every time he posts. like here in daniweb.com whenever i post a thread it displays "Newbie poster" below my username. I don't have any idea how to do that...Help me plzzzzzzz.
Thankyou...,,,,..,..,..,...,.,.,.,.,,

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by Designer_101
0

How do you know whether a user is an admin or a regular member? If it is a database field then simply display that as well.

0

Hi

To explain what slyme said above you will need to add an aditional field in your table containing your members information. Then whenever you echo the username simply echo the "priv" field that should hold either the text "admin" or "standard user".

You should set the default value to "standard user" so that only you may edit who is an "admin" by editing the database.

A quick example but it's probably got mistakes i've only got 5mins :

<h1>List of members and priv's</h1>
$query = "SELECT * FROM members";
$result = mysql_query($query);
while ($col = mysql_fetch_array($result)) {
echo $col['username'];
echo "<br><br>They are a/an:";
echo $col['priv'];
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.