Leveecius Posted October 31, 2009 Share Posted October 31, 2009 Hey guys, I'm trying to get something to show differently in one of my scripts. I'm trying to make it so that people that are a certain rank in my game will have their names show up bold in the users online. so I figured it would go like this: mysql_query("SELECT * FROM users WHERE username='$username'"); $rank=$rows['rank']; $rankpoints=$rows['rankpoints']; if($rankpoints>=50000){ echo '<b>$rank</b>' ; } Is that right? Because normally when they hit this certain rank, it updates their rank in the database to RANK. However, when viewing users online, it doesn't show it. Anyone know why? Either way, I would like for them to get their names in bold. Link to comment https://forums.phpfreaks.com/topic/179737-quick-question-about-echo-value/ Share on other sites More sharing options...
Jnerocorp Posted October 31, 2009 Share Posted October 31, 2009 Well Assuming $rank is there username then try this <?php mysql_query("SELECT * FROM users WHERE username='$username'"); $rank=$rows['rank']; $rankpoints=$rows['rankpoints']; $be_bold = "50000"; if ($rankpoints > $be_bold) { echo "<b>$rank</b>"; } ?> Link to comment https://forums.phpfreaks.com/topic/179737-quick-question-about-echo-value/#findComment-948328 Share on other sites More sharing options...
Jnerocorp Posted October 31, 2009 Share Posted October 31, 2009 actually use this code: sorry for the double post <?php $result = mysql_query("SELECT * FROM users WHERE username='$username'") or die(mysql_error()); $row = mysql_fetch_array($result) $rank=$rows['rank']; $rankpoints=$rows['rankpoints']; $be_bold = "50000"; if ($rankpoints > $be_bold) { echo "<b>$rank</b>"; } ?> Link to comment https://forums.phpfreaks.com/topic/179737-quick-question-about-echo-value/#findComment-948331 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.