Log in

View Full Version : Resolved member list- make admin different colour from users



liamallan
03-22-2010, 03:01 PM
i am working on a members list which displays everyone who is registered at site. i am trying to make admin a different colour from regular users so users know who admin are.

here is my attempt:

<table width="200" border="1" cellspacing="0" cellpadding="3">
<tr>
<td align="center"><strong><u>Registered Members</u></strong></td>

</tr>
<?php
while($rows=mysql_fetch_array($query)){
?>
<tr>
<td align="center">
<?php
if($rows['userlevel']= '9'){
echo '<a href="http://www.shiftysplayground.co.cc/userinfo.php?user='.$rows['username'].'"><font color="gold">'.$rows['username'].'</font></a>';
}
else{
echo '<a href="http://www.shiftysplayground.co.cc/userinfo.php?user='.$rows['username'].'">'.$rows['username'].'</a>';
}
?>
</td>
</tr>
<?php
}
?>
</table>
it works to some extent but all names in the table turn gold instead of just admin. can anyone tell me where i went wrong? thanx

djr33
03-22-2010, 06:27 PM
($rows['userlevel']= '9')
That is SETTING the variable to 9. = means "set the left side to the right value".
== is the comparison operator:
($rows['userlevel']== '9')

liamallan
03-22-2010, 06:58 PM
thanks again mate, bet ur sick of my face lol i always seem to overlook the simple things. your help is alway greatly appreciated!