Table: cm_rank
|id|rankpoeng|tittel |
-----------------------
|1 | 0 |Sivil |
|2 | 322 |Wannabe|
|3 | 1450 |Hitman |
What I'm trying to do:
$currentXp = 500;
$query = mysql_query("SELECT * FROM cm_rank WHERE $currentXp > rankpoeng LIMIT 1");
while ($rows = mysql_fetch_array($query)):
$levelTitle = $rows['title'];
echo $levelTitle;
endwhile;
The $levelTitle variable should only hold the text "Wannabe", since the users has more xp than it requires, but not enought for the next rank.
How may I structure up a query like this?
but not enought for the next rank.? Is there a bench mark ?