[Tutorial] MySQL - Event scheduler
#13

Quote:
Originally Posted by Abagail
View Post
Will something like this work?
pawn Code:
new query[100];
new interval[30];
format(interval, sizeof(interval), "1 DAY");
mysql_format(connectionHandler, query, sizeof(query),
"CREATE EVENT `unbanall` ON SCHEDULE AT CURRENT_TIMESTAP() + INTERVAL '%s' \
DO \
UPDATE `mybans` SET `banSTATUS`=0"
, interval);
You seem to be an expert on this function, and I can't find anything relevant on the documentation page.
Yes it will work because the output query would look like : CREATE EVENT `unbanall` ON SCHEDULE AT CURRENT_TIMESTAMP() + INTERVAL 1 DAY DO UPDATE `mybans` SET `banSTATUS`=0
Though, I believe query's size should be increased.

NOTE : It's CURRENT_TIMESTAMP, not TIMESTAP because I had a little typo on my main post.


Quote:
Originally Posted by jamjamnewbie
View Post
What the.. This is the first time I've seen this function


pawn Code:
mysql_tquery(connectionHandler,
"CREATE EVENT `unbanall` ON SCHEDULE AT CURRENT_TIMESTAP() + INTERVAL 1 DAY \
DO \
UPDATE `mybans` SET `banSTATUS`=0"
, "", "");
//After 1 day, every bans will be expired from my table.
//Even if the server is shut down, this schedule will be running as long as MySQL server is up and if the event is enabled.
TIMESTAP or TIMESTAMP?

Anyways, good tutorial, can be used for many things, I know
It's CURRENT_TIMESTAMP. STAP was little typo there.
Reply


Messages In This Thread
MySQL - Event scheduler - by Lordzy - 16.11.2014, 16:05
Re: MySQL - Event scheduler - by sammp - 16.11.2014, 16:13
Re: MySQL - Event scheduler - by sammp - 16.11.2014, 16:16
Re: MySQL - Event scheduler - by Lordzy - 16.11.2014, 16:26
Re: MySQL - Event scheduler - by Kyle - 16.11.2014, 16:26
Re: MySQL - Event scheduler - by Lordzy - 16.11.2014, 16:45
Re: MySQL - Event scheduler - by Jay_ - 16.11.2014, 18:17
Re: MySQL - Event scheduler - by Abagail - 16.11.2014, 19:46
AW: MySQL - Event scheduler - by Mellnik - 16.11.2014, 20:35
Re: MySQL - Event scheduler - by Abagail - 16.11.2014, 21:36
Re: MySQL - Event scheduler - by jamjamnewbie - 16.11.2014, 21:54
Re: MySQL - Event scheduler - by Abagail - 16.11.2014, 21:55
Re: MySQL - Event scheduler - by Lordzy - 17.11.2014, 01:01
Re: MySQL - Event scheduler - by Abagail - 17.11.2014, 01:07
Re: MySQL - Event scheduler - by Lordzy - 17.11.2014, 01:13
Re: MySQL - Event scheduler - by Abagail - 17.11.2014, 01:14
Re: MySQL - Event scheduler - by Raefal - 17.11.2014, 07:33
Re: MySQL - Event scheduler - by RajatPawar - 17.11.2014, 12:41
Re: MySQL - Event scheduler - by Lordzy - 17.11.2014, 14:22
Re: MySQL - Event scheduler - by CoaPsyFactor - 17.11.2014, 14:26
Re: MySQL - Event scheduler - by RenovanZ - 18.11.2014, 08:48
Re: MySQL - Event scheduler - by Lordzy - 26.11.2014, 10:16
Re: MySQL - Event scheduler - by Arastair - 26.11.2014, 10:42
Re: MySQL - Event scheduler - by Luis- - 26.11.2014, 12:24
Re: MySQL - Event scheduler - by Finn - 26.11.2014, 13:34
Re: MySQL - Event scheduler - by Djole1337 - 26.11.2014, 13:41
Re: MySQL - Event scheduler - by Luis- - 26.11.2014, 13:56
Re: MySQL - Event scheduler - by Finn - 26.11.2014, 17:47
Re: MySQL - Event scheduler - by fall3n - 25.12.2014, 11:35
Re: MySQL - Event scheduler - by HydraHumza - 05.10.2015, 11:32
Re: MySQL - Event scheduler - by Lordzy - 19.12.2016, 09:16
Re: MySQL - Event scheduler - by Eoussama - 31.05.2018, 20:36

Forum Jump:


Users browsing this thread: 2 Guest(s)