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

Quote:
Originally Posted by Grim_
Посмотреть сообщение
Your problem would consist at trying to insert "%d/%d/%d" - MySQL syntax is different from file functions.

Firstly, make sure that the Date and Time options are strings, then do something like the following:
pawn Код:
format(string, 20, "%d/%d/%d", month, day, year);
format(string2, 20, "%d:%d:%d", hour, minute, second);
format(Query, sizeof(Query), "INSERT INTO `Admin Logs` (`AdminName`, `PlayerName`, `Action`, `Reason`, `Date`, `Time`) VALUES('%s', '%s', '%s', '%s', '%s', '%s')", adminname, playername, action, reason, string, string2);
Better yet, you could use the default time and date functions included in MySQL - look them up.
I tried doing it with strings like you did, but no difference. I will look into the default time and date functions for MySQL.

EDIT: I have been looking for something, but I only found a MySQL manual which really didn't explain anything to me. Could somebody be of some assistance?
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)