Welcome to WebmasterWorld Guest from 54.145.208.64

Forum Moderators: open

Message Too Old, No Replies

Little Help Needed

mysql,display

   
3:57 pm on Jun 28, 2010 (gmt 0)



Hi Guys

New Here, need some help which ive been trying to figure out for a few days now... hard to explain what i want really

i have a website.. with members etc.. and when a member is made a moderator, administrator for example... in the database the field changes to "0" or "5" for example

What i want is on there home page... if there membership status is 0 or 5... 0 displays as Member and 5 displays as Admin

ide appreciate any help

Thanks
5:51 pm on Jun 28, 2010 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Welcome aboard DavidC145, this would be a function of the programming that reads the database, most likely PHP these days. You might have better luck in the PHP forum, and when you get there, specify what software you're using, unless it's custom coded.
5:24 pm on Jul 9, 2010 (gmt 0)



If you are using PHP, you could try this:

switch $colname {
case 0:
echo 'Member';
break;

case 5:
echo 'Admin';
break;

}


Does this help?
5:58 pm on Jul 9, 2010 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



While that works, it's a little excessive, and requires more maintenance as things change . . .

$this_level = 3; // member's level from DB

$levels = Array ('Member','Premier Member','Really Cool Member','Admin Wannabe','Royal Underling', 'Administrator');

echo $levels[$this_level];