20.11.2018, 15:49
Hey guys, i have a test cmd that gave me info about how many players haven't login in the past 30 days.
The problem is, it shows only if the data in database is stored as year/month/days instead of days/month/year.
Any idea why ? here's the cmd.
UPDATE: The structure 'LastLog' in database is formed as VARCHAR
The problem is, it shows only if the data in database is stored as year/month/days instead of days/month/year.
Any idea why ? here's the cmd.
UPDATE: The structure 'LastLog' in database is formed as VARCHAR
Код HTML:
CMD:lastlog(playerid) { new string[90], dialog[90], i, iResult[90], query[90]; gQuery[0] = EOS; mysql_format(SQL, string, sizeof(string), "SELECT * FROM `users` WHERE `LastLog` + INTERVAL 30 DAY <= NOW() ORDER BY `ID` DESC LIMIT 20"); new Cache:r = mysql_query(SQL, string); strcat(dialog, "ID\tLastLog\n"); while(i < cache_num_rows()) { cache_get_field_content(i, "LastLog", iResult); format(query, 32, iResult); format(string, sizeof(string), "%d\t%s\n", i+1, query); strcat(dialog, string); i++; } cache_delete®; ShowPlayerDialog(playerid, 123, DIALOG_STYLE_TABLIST_HEADERS, "LastLog", dialog, "Select", "Close"); return 1; }