Next lowest value in MySQL Database [migrated]
- by Justin Edwards
SELECT * 
FROM  `experience` 
WHERE  `reqexp` <>  '4793'
ORDER BY  'lvl' DESC 
LIMIT 1
Here is what I want to do. I am making an online game for a client, and need to be able to use a mysql query with a random value, and find the level associated with that amount of experience. In this case, I need to find the next value lower than 4793 that already exists in the database so I can determine the players appropriate level. Any Ideas?