02.11.2014, 22:44
Hello everyone.
I want a function like gettime and getdate of pawn, but using a value of a MySQL field, but I have no idea how to do this.
I use BlueG plugin and I did a test:
And it returned 2014, I think that it returns the year, but the content of that field has a date-time format.
So how can I create or use a function like this?
Or something similar
I think also that using UNIX Timestamp (or something like that), is very hard to use, because I want compare months, years, days, etc, like an integer, anyway it doesn't return UNIX Timestamp and if that could work, convert that to 6 integers I think that is a big problem :P for me...
Thanks if someone can help me
I want a function like gettime and getdate of pawn, but using a value of a MySQL field, but I have no idea how to do this.
I use BlueG plugin and I did a test:
pawn Код:
YCMD:test(playerid, params[], help)
{
if(Player[playerid][Level] < 3)
return 0;
new Query[64];
mysql_format(ID, Query, sizeof(Query), "SELECT Re_Date FROM Users WHERE PlayerName='Wil'");
new Cache:result = mysql_query(ID, Query);
ENME(playerid, -1, "%d", cache_get_field_content_int(0, "Re_Date", ID));
cache_delete(result, ID_Conexion);
return 1;
}
So how can I create or use a function like this?
pawn Код:
cache_get_field_content_date(row, const field_name[], connectionHandle = 1, &year, &month, &day)
I think also that using UNIX Timestamp (or something like that), is very hard to use, because I want compare months, years, days, etc, like an integer, anyway it doesn't return UNIX Timestamp and if that could work, convert that to 6 integers I think that is a big problem :P for me...
Thanks if someone can help me