Jump to content

Sotring a db Table


'LinKin

Recommended Posts

Hello,

I use the SQL functions by default for MTA.

I have a table.

I want it so that when a player clicks Tops>SelectedValue*

Note: SelectedValue is the column which you want to recieve tops of. (1st, 2nd, 3rd, Playtime, etc..)

It shows the Top 10 players regarding the SelectedValue.

How can I make this? Sort the table by the selected column and printing the first 10 lines? Or anyother way?

Thanks

Link to comment
local result = executeSQLQuery("SELECT playerName, timeText, dateRecorded, extra  FROM ? ORDER BY timeMS ASC LIMIT 10", mapname ) 
  

This is what I do in my toptimes script.

If I wanted to sort the the entire table, (without limit) would I be able to do so just by deleting "LIMIT 10" from the Query?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...