[PHP/MYSQL] Help needed
#1

Hello,

I currently have an intention to make a leaderboard displaying the 'top 10 players' that includes (Score, Kills, Deaths) could anyone help by posting an example of what the mysql query should look like?

Regards,
MD5
Reply
#2

SELECT `score`, `kills`, `Deaths` FROM `players` LIMIT 10 ORDER BY `id` DESC;
Reply
#3

Now, what goes below it: $blahb = blab($query); ?

Thanks!
Reply
#4

Check examples on php.net. Your best source of information: http://be2.php.net/manual/en/mysqli.query.php

Don't use the "mysql" module anymore since it's deprecated. Either use mysqli (linked above) or PDO.
Reply
#5

So like?

Код:
mysqli_query("SELECT `score`, `kills`, `Deaths` FROM `players` LIMIT 10 ORDER BY `id` DESC", MYSQLI_USE_RESULT);

$results = mysqli_free_result($result);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)