12.11.2010, 21:04
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:
This is the error:
I am using G-Stylez MySQL plugin.
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);
}
Код:
[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)