[HELP] please help get date -
Luca12 - 03.04.2014
Hello how can I get date on onplayerdisconnect and then it save like that 2/4/2014 in mysql but instead of that I get something like 167.833333333333333333. I have something like this but I have problem since last night and from then I can't solve it. I was all day spend on get date in mysql acc to be written but nothing. I save date as varchar and I have variable PlayerInfo[playerid][LastActivity]. So here is what I have on public onplayerdisconnect
pawn Код:
new str[255],day,month,year;
getdate(day,month,year);
format(str,255,"%d/%d/%d",day,month,year);
strmid(PlayerInfo[playerid][LastActivity],str,0,strlen(str),255);
and here is saving
mysql_format(mysql,query,sizeof(query),"UPDATE `users` SET `LastActivity` = %s
Re: [HELP] please help get date -
]Rafaellos[ - 03.04.2014
You are missing the ID at the end.
Re: [HELP] please help get date -
Luca12 - 03.04.2014
I just give for activity how I save it
Re: [HELP] please help get date -
]Rafaellos[ - 03.04.2014
Your giving the LastActivity value on "`LastActivity` = %s", but you are not giving the ID in "WHERE `ID` = '%d'".
Re: [HELP] please help get date -
Luca12 - 03.04.2014
I give lastctivity how I save it beacuse is that problem not some id
Re: [HELP] please help get date -
Jstylezzz - 03.04.2014
Can you post the whole MySQL query please? Also, make sure that in the MySQL database the variable type of LastActivity is VARCHAR, not FLOAT or DECIMAL or something.
Re: [HELP] please help get date -
Luca12 - 03.04.2014
I was go somewhere in d/d/d format I was move // and know in mysql have 201443 it is year-month-day but how can I get it like d/d/d if I set in format // it will be 168.78333333
pawn Код:
format(str,512,"%d%d%d",dan,mjesec,godina);
PlayerInfo[playerid][ZadnjaAktivnost] = str; know like that is 201443
if I set
format(str,512,"%d/%d/%d",dan,mjesec,godina);
PlayerInfo[playerid][ZadnjaAktivnost] = str; it will be 168,7833333
and here is the query in onplayerdisconnect
mysql_format(mysql,query,sizeof(query),"UPDATE `users` SET `LastActivity` = %s, WHERE `ID` = '%d'",
PlayerInfo[playerid][LastActivity],PlayerInfo[playerid][ID]);
Re: [HELP] please help get date -
Jstylezzz - 03.04.2014
Check your MySQL database variable type. Make sure it's a VARCHAR and not a FLOAT or whatsoever.
Re: [HELP] please help get date -
Luca12 - 03.04.2014
yes it's varchar
Re: [HELP] please help get date -
Luca12 - 04.04.2014
please, anyone?thanks