04.06.2014, 21:19
I'm trying to store Name, IP and Date into a "connections" table in mysql however it doesn't seem to work. IP comes out as "49" and date is "0000-00-00".
IP: Set to varchar of 16. Date set to DATE in table.
P.S, Name works.
pawn Код:
new ip[16], hour, minute, second;
GetPlayerIp(playerid, ip, sizeof(ip));
gettime(hour, minute, second);
format(query, sizeof(query), "INSERT INTO `connections` (`Name`, `IP`, `Date`) VALUES ('%s', '%s', '%d:%d:%d')", GetName(playerid), ip, hour, minute, second);
mysql_tquery(sqldb, query, "Query", "i", playerid);
P.S, Name works.