I’m almost done with this system.
There is one thing I’m struggling with. If I insert a new high score with new name, it gets on the top.
My issue is that the player with same name scoring the same score as the highest after second time does not put his position up. For example…
I insert a highest score with name “A” which gets on top.
Then I insert a higher score with name “B” which appear on top.
If I insert a score same as “B” with name “A”, it does not go on top.
However, if I insert a same score with name “C”, it gets on top.
My table is structured as following: “CREATE TABLE Records (name TEXT, score INTEGER, date DATE)”
The date contains with the format, “Y-m-d H:i:s”.
This is the query I’m doing to get them.
$query = “SELECT name, MAX(score) as highscore FROM Records GROUP BY name ORDER BY score DESC, date DESC LIMIT 0, 10”;
Can someone suggest what I’m doing wrong?