3raser Posted February 6, 2010 Share Posted February 6, 2010 I'm currently working with Visual Basics and PHP. (I'm pretty advanced in PHP) I just want to know after they submit their scores, how do I make it so the database finds the HIGHEST score to display on the website? Quote Link to comment https://forums.phpfreaks.com/topic/191110-finding-the-biggest-number/ Share on other sites More sharing options...
premiso Posted February 6, 2010 Share Posted February 6, 2010 Assuming you are using MySQL: SELECT score FROM table_name ORDER BY score DESC Quote Link to comment https://forums.phpfreaks.com/topic/191110-finding-the-biggest-number/#findComment-1007706 Share on other sites More sharing options...
trq Posted February 6, 2010 Share Posted February 6, 2010 SELECT MAX(fld) FROM tbl Quote Link to comment https://forums.phpfreaks.com/topic/191110-finding-the-biggest-number/#findComment-1007707 Share on other sites More sharing options...
3raser Posted February 6, 2010 Author Share Posted February 6, 2010 How is it possible to get their username also? Like the Highest score and then get the owner's username of that score? Quote Link to comment https://forums.phpfreaks.com/topic/191110-finding-the-biggest-number/#findComment-1007718 Share on other sites More sharing options...
premiso Posted February 6, 2010 Share Posted February 6, 2010 By using the GROUP BY function, you will want to GROUP BY user. Quote Link to comment https://forums.phpfreaks.com/topic/191110-finding-the-biggest-number/#findComment-1007720 Share on other sites More sharing options...
3raser Posted February 6, 2010 Author Share Posted February 6, 2010 Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/191110-finding-the-biggest-number/#findComment-1007723 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.