Jumpy09 Posted June 10, 2010 Share Posted June 10, 2010 $rankcheck = mysql_query("SELECT r.titlem FROM users as u,rank as r WHERE u.points >= r.pointsreq AND u.uid = '$uid'"); $row = @mysql_fetch_array($rankcheck); $rank=$row['titlem']; 0 Points = Unknown 100 Points = Traveler It's showing Unknown even if I have 101 points. But it works, in a way. Is there any way to make this pull a user's rank title by how many points they have? Thanks in advance for the help. Quote Link to comment https://forums.phpfreaks.com/topic/204370-get-rank-by-points/ Share on other sites More sharing options...
Andy-H Posted June 10, 2010 Share Posted June 10, 2010 $rankcheck = mysql_query("SELECT r.titlem FROM users as u,rank as r WHERE u.points >= r.pointsreq AND u.uid = '$uid' ORDER BY r.pointsreq DESC LIMIT 1"); $row = @mysql_fetch_assoc($rankcheck); $rank = $row['titlem']; ?? Quote Link to comment https://forums.phpfreaks.com/topic/204370-get-rank-by-points/#findComment-1070260 Share on other sites More sharing options...
Jumpy09 Posted June 10, 2010 Author Share Posted June 10, 2010 Sweet that works! Thanks! Also thanks for the tidying up! I've never seen that before, I've got to start using it. Quote Link to comment https://forums.phpfreaks.com/topic/204370-get-rank-by-points/#findComment-1070264 Share on other sites More sharing options...
Andy-H Posted June 10, 2010 Share Posted June 10, 2010 No problem, glad I could help. Quote Link to comment https://forums.phpfreaks.com/topic/204370-get-rank-by-points/#findComment-1070269 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.