954,585 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

PHP to calculate next number in sequence from MySQL table ?

I have a mysql table with the following data in it:

user_id score
1234 28
4654 -15
5986 15
3657 10

If i have PHP select the score column for user 5986 how could i then have PHP calculate the next highest score in the MySQL table ?

toasty525
Newbie Poster
10 posts since Jul 2007
Reputation Points: 10
Solved Threads: 0
 

Use this query. Replace 15 with the actual score from your user.

select score from table where score > 15 order by score asc limit 1
pritaeas
Posting Expert
Moderator
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You