MySQL Forums
Forum List  »  Newbie

Sorting table and then look for ID
Posted by: Mikkel Mikkelsen
Date: November 05, 2021 08:19AM

So im currently making a leaderboard for a project. The leaderboard contains a few values and a ID.
Im trying to sort the table by, lets say, value1.

That is just all fine, but i want the ID for that row, and especially the row number that it's at after the sorting!

How do I go about this?

I did something like this, but not sure how to retrive the result row id.

$result = $mysqli->query("SELECT * FROM scoreboard_table WHERE steam64Id='". $nameOrId ."' OR userName like '%". $nameOrId ."%'");
if ($mysqli->error.is_string()) return;
$record = mysqli_fetch_assoc($result)

Options: ReplyQuote

Written By
Sorting table and then look for ID
November 05, 2021 08:19AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.