using mysql UNIX_TIMESTAMP function to store timestamps
authorpk910 <philipp@zoelle1.de>
Thu, 8 Sep 2011 03:14:05 +0000 (05:14 +0200)
committerpk910 <philipp@zoelle1.de>
Thu, 8 Sep 2011 03:14:05 +0000 (05:14 +0200)
cmd_neonserv_addban.c

index 91202d947c0669ee441f663ce838bc9ff6096960..245190b391607c94c678c84d4ce3d87a174c6740 100644 (file)
@@ -76,6 +76,6 @@ static void neonserv_cmd_addban_async1(struct ClientSocket *client, struct Clien
     else
         return;
     //add the ban
-    printf_mysql_query("INSERT INTO `bans` (`ban_channel`, `ban_mask`, `ban_triggered`, `ban_owner`, `ban_reason`) VALUES ('%d', '%s', '%u', '%d', '%s')", chan->channel_id, escape_string(mask), (unsigned int) time(0), userid, escape_string(reason));
+    printf_mysql_query("INSERT INTO `bans` (`ban_channel`, `ban_mask`, `ban_triggered`, `ban_owner`, `ban_reason`) VALUES ('%d', '%s', UNIX_TIMESTAMP(), '%d', '%s')", chan->channel_id, escape_string(mask), userid, escape_string(reason));
     reply(getTextBot(), user, "NS_ADDBAN_DONE", mask, chan->name, match_count);
 }