alexcsandru Posted February 1, 2010 Share Posted February 1, 2010 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 https://forums.phpfreaks.com/topic/190511-create-event-in-mysql-problem/ Share on other sites More sharing options...
fenway Posted February 1, 2010 Share Posted February 1, 2010 See -- locked. Link to comment https://forums.phpfreaks.com/topic/190511-create-event-in-mysql-problem/#findComment-1004987 Share on other sites More sharing options...
Recommended Posts