Jump to content

Create Event in mysql (problem)


alexcsandru

Recommended Posts

I want to create this event

CREATE EVENT Rank
ON SCHEDULE 
EVERY 30 SECOND
DO 
SET @rank=0;
UPDATE users SET rank=@rank:=@rank+1 ORDER BY points DESC;

to update in my table rank ...

 

+----+-------------+----------+--------+--------------+--------+------+
| id | username    | password | banned | colonization | points | rank |
+----+-------------+----------+--------+--------------+--------+------+
|  1 | alexcsandru | secret   | N      |            1 |     57 |    9 |
|  2 | ovidiu      | bossul   | N      |            1 |      2 |    11 |
|  3 | ropy        | mypass   | N      |            1 |     14 |    12 |
|  4 | bobo        | bobica   | N      |            1 |      2 |    10 |
+----+-------------+----------+--------+--------------+--------+------+

 

And mysql comand...

mysql> CREATE EVENT rank ON SCHEDULE EVERY 30 SECOND DO
    -> SET @rank=0 ; UPDATE users SET rank=@rank:=@rank+1 ORDER BY points DESC;
Query OK, 0 rows affected (0.00 sec)

Query OK, 4 rows affected (0.00 sec)
Rows matched: 4  Changed: 4  Warnings: 0

 

This event don't Work !!! (I am a beginner in mysql event)

 

Thanks...

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.