A rank users order by points


Posted on 16th Feb 2014 07:03 pm by admin

I want to make an insert from table 'rank' , with number (rank) from the cod blow, to fild users.rank ...

set @rank := 0;
select @rank:=@rank+1 'rank', users.username, users.points from users order by points desc;
Code: +------+-------------+--------+
| rank | username | points |
+------+-------------+--------+
| 1 | ropy | 98 |
| 2 | alexcsandru | 17 |
| 3 | bobo | 17 |
| 4 | ovidiu | 5 |
+------+-------------+--------+
How to do??

P.S.: to insert rank in users.rank table... and with a function reload_player_rank() of 30 in 30 minutes (to update new rank in table users.rank) .


A solution please

No comments posted yet

Your Answer:

Login to answer
75 Like 54 Dislike
Previous forums Next forums
Other forums

Simpler method of getting variables from mysql
Hi Guys,

I'm trying to streamline my CMS's code and as I was writing a new page it occured to

retrieving more than one max key from an array?
so i have an array of 20 numerical values (0-100) that i need to order from highest to lowest and th

Undefined variable when using $_SERVER['PHP_SELF']
Hi guyz, please suggest me something...
On first.php I have one input field NAME, and on posting

set xml path in flash when xml created in memorystream and webrequest
i am creating an xml file using memory stream and i want to load this xml file into the flash on cli

update 2 columns by doing inner 2-column query
Hi,
is something like this possible?

update contract_all set col1,col2 =
(

Page not Loading After Test
Hey All

It seemed that an inlcude statement wasn't working for some reason, so I tried a more

javascript in php code causes page to display white
Hi All,

Odd one this, I've got the following code (below) which is a simple log in form. The

A WBS element with the name XXX already exists in version FREI_VERSION
Hi.
When I am trying to insert WBS element in a project, error occurs:

"A WBS eleme

Help on code output
My CODE:

Code: [Select] echo "<phone>".$line["phone"].&qu

Tracking Unique Clicks
Hi guys and gals,

Basically I have a database which tracks clicks on my outbound links, I do

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash