Ordered mysql selection
#1

Hello, I want to make a command that displays all the registered admins in my server and ordered from high levels to low levels. Accounts are in a MySQL database, and I just want that query line, I forgot what was it but as I remember it was something like:

PHP код:
SELECT FROM accounts WHERE Admin != 0 ORDERED.. I FORGOOOT IT HELP ME 
Admins list should look like:
Level 5 - Ahmed
Level 4 - TheSuperWhatever
Level 4 - Huehuehuehue
Level 3 - IAmAdminLevel3
Level 2 - HoldenBee
Level 2 - MasterZ
Level 1 - Kingoy
Level 1 - AssassinoZ
Level 1 - PlueyZ
Level 1 - NolyF
Reply
#2

try this sir.
PHP код:
SELECT FROM `accountsWHERE Admin 0 ORDER BY `accounts`.`AdminDESC 
Reply
#3

PHP код:
SELECT FROM `accountsWHERE `Admin` > 0 ORDER BY `AdminDESC 
Reply
#4

You don't need to select all the data but rather their name and level instead.

pawn Код:
"SELECT Admin, Name FROM accounts WHERE Admin <> 0 ORDER BY Admin DESC"
Reply
#5

Okay thank you all so much but, after I store the result, the first row in the result is gonna be admin level 1 or what?
Reply
#6

The first row (0) is the highest level
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)