21.03.2015, 01:04
Hello guys, I'm experiencing a small problem.
I'm using mysql r39-2 plugin.
When a player logs onto his account I send a query to update their last login time
The type of the field in the database is datetime so it looks like
As I want to return ingame in this format: March 17, 2015 17:00:03 I tried to use the date_format function, but I'm not sure how to take the result and send it as a message ingame.
So far I did this:
So I need help about how to take the result and send it. So instead of:
It will be:
Thanks in advance.
I'm using mysql r39-2 plugin.
When a player logs onto his account I send a query to update their last login time
pawn Код:
mysql_format(MC, query, sizeof(query), "UPDATE players SET IP = '%s', LastLogin = NOW() WHERE Name = '%s'", PlayerIP[playerid], Name[playerid]);
mysql_tquery(MC, query);
Код:
2015-03-17 17:00:03
So far I did this:
pawn Код:
mysql_query(MC, "SELECT DATE_FORMAT( 'LastLogin' , '%%M %%d %%Y %%h:%%i:%%s' ) AS `LastLogin` FROM `players` WHERE `Name` = '%s' LIMIT 1", Name[playerid]);
Код:
Welcome back, your last login was on 2015-03-17 17:00:03
Код:
Welcome, back your last login was on March 17 2015 17:00:03