Click here to Skip to main content
15,917,565 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello people,

i am stuck with this, please help me, how to do this.

i have a sql table, with fields,

name, username, score,

the table contains, data like this,

user1 username1 5
user2 username2 10
user1 username1 2
user2 username2 1

Now, i need a php and sql script to show a sorted table,with a user should appear only once with their highscores.

Like,

user2 username2 10
user1 username 5

Your help is verymuch needed, thank you!
Posted

in sql its very simple sql query:

SQL
select Name, Username, max(score) from tbl group by Name, Username
 
Share this answer
 
Learn to do it from this very comprehensive tutorial: Accessing SQL Server Databases with PHP[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900