Welcome to WebmasterWorld Guest from 54.159.50.111

Forum Moderators: open

Message Too Old, No Replies

Little Help Needed

mysql,display

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

New User

5+ Year Member

joined:June 28, 2010
posts: 1
votes: 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 June 28, 2010 (gmt 0)

Senior Member

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

joined:Nov 28, 2004
posts:7999
votes: 0


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 July 9, 2010 (gmt 0)

New User

5+ Year Member

joined:July 9, 2010
posts: 4
votes: 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 July 9, 2010 (gmt 0)

Senior Member

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

joined:Nov 28, 2004
posts:7999
votes: 0


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];