Using dates | MySQL with Pawn
#1

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:
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;
}
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?
pawn Код:
cache_get_field_content_date(row, const field_name[], connectionHandle = 1, &year, &month, &day)
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
Reply


Messages In This Thread
Using dates | MySQL with Pawn - by Su37Erich - 02.11.2014, 22:44
Re: Using dates | MySQL with Pawn - by Vince - 03.11.2014, 05:35
Re: Using dates | MySQL with Pawn - by Runn3R - 03.11.2014, 09:43
Re: Using dates | MySQL with Pawn - by Su37Erich - 03.11.2014, 20:09

Forum Jump:


Users browsing this thread: 1 Guest(s)