plodos Posted August 8, 2008 Share Posted August 8, 2008 EACH MEMBER HAS GRADE like that sql table CREATE TABLE `person` ( .............................. `grade` INT NOT NULL, ............................. ) php/query for list the members without GRADE system <?php include('dbconfig.php'); $data = mysql_query("select p.* from join_person_committee j, person p where j.committee_id=1 AND j.person_id = p.person_id"); //sample query without GRADE while($info=mysql_fetch_array($data)) { echo" {$info['fname']} {$info['lname']}, {$info['country']} <br>"; echo" {$info['uni']}<br>"; echo" {$info['uni_dept']}<br>"; } ?> grade = 0 normal member grade = 0-50 silver member grade = 50-100 gold member If user has 100 Grade, output will be like that echo" {$info['fname']} {$info['lname']}, {$info['country']} ([b]GOLD MEMBER[/b])<br>"; echo" {$info['uni']}<br>"; echo" {$info['uni_dept']}<br>"; If user has 50 Grade, output will be like that echo" {$info['fname']} {$info['lname']}, {$info['country']} ([b]SILVER MEMBER[/b])<br>"; echo" {$info['uni']}<br>"; echo" {$info['uni_dept']}<br>"; If user has 0 Grade, output will be like that echo" {$info['fname']} {$info['lname']}, {$info['country']} ([b]NORMAL MEMBER[/b])<br>"; echo" {$info['uni']}<br>"; echo" {$info['uni_dept']}<br>"; Thats not possible to write NORMAL/SILVER/GOLD MEMBERs one by one for each user..There must be a auto-system.. You understood what I mean... How can I write these code? What must I do? Who can give me the sample/example code? Thanks for helping me.... Quote Link to comment Share on other sites More sharing options...
waynew Posted August 8, 2008 Share Posted August 8, 2008 Just do the calculations when you're printing it out. IF score > 80 echo Gold member. Or you could create another column and insert their level and/or update their level. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.