homepage Welcome to WebmasterWorld Guest from 54.161.166.171
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderators: physics

Databases Forum

    
Little Help Needed
mysql,display
DavidC145




msg:4160745
 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

 

rocknbil




msg:4160818
 5:51 pm on Jun 28, 2010 (gmt 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.

abcorn




msg:4167285
 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?

rocknbil




msg:4167308
 5:58 pm on Jul 9, 2010 (gmt 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];

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved