I don't see what I'm doing wrong...
#1

Hi guys. I am trying to "log" all things that admins do in-game and put it in a table in my MySQL database. I keep getting an error with this piece of code though:

pawn Код:
stock AdminLog(adminname[], playername[], action[], reason[])
{
    new hour, minute, second, year, month, day, time[9];
    gettime(hour, minute, second);
    getdate(year, month, day);

    format(Query, sizeof(Query), "INSERT INTO `Admin Logs` (`AdminName`, `PlayerName`, `Action`, `Reason`, `Date`, `Time`) VALUES('%s', '%s', '%s', '%s', %d/%d/%d, %d:%d:%d)", adminname, playername, action, reason, month, day, year, hour, minute, second);
    mysql_query(Query);
}
This is the error:

Код:
[17:10:45] CMySQLHandler::Query(INSERT INTO `Admin Logs` (`AdminName`, `PlayerName`, `Action`, `Reason`, `Date`, `Time`) VALUES('RealCop228', 'RealCop228', 'Gave Weapon(s)', 'N/A', 11/12/2010, 17:10:45)) - An error has occured. (Error ID: 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':10:45)' at line 1)
I am using G-Stylez MySQL plugin.
Reply


Messages In This Thread
I don't see what I'm doing wrong... - by Scenario - 12.11.2010, 21:04
Re: I don't see what I'm doing wrong... - by Grim_ - 12.11.2010, 21:19
Re: I don't see what I'm doing wrong... - by Scenario - 12.11.2010, 21:48

Forum Jump:


Users browsing this thread: 1 Guest(s)