Quote:
Originally Posted by Abagail
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
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_TIMESTA
MP. STAP was little typo there.