Problem with ranking users

Hi, I want to rank my users for a high score.

I tried putting this query in MySQL:

$sql = 'SELECT * FROM users ORDER BY points DESC, username ASC LIMIT 20';

but got this reply:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$sql = 'SELECT * FROM users ORDER BY points DESC, username ASC LIMIT 20'' at line 1

What have I done wrong? the table is called users and there is username and points in it.

Also, I’ve tested a few other queries with success, but I don’t know how to actually show the ranking in a .php page. And I’ve looked everywhere and can’t get an explanation of this.

Thanks