Posts: 170
Threads: 10
Joined: Sep 2011
Код HTML:
CMySQLHandler::Query(INSERT INTO `game_logs` (`uid`,`owner`,`charid`,`adminid`,`kara`,`powod`) VALUES ('1','2', '102', '2', '9', 'test') - 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 '' at line 1)
Code:
Код HTML:
stock Punishment(type,playerid,admin,reason[],time)
{
new query[256];
new uid = GetFreeSQLUID("game_logs", "uid");
format(query, sizeof(query), "INSERT INTO `game_logs` (`uid`,`owner`,`charid`,`adminid`,`type`,`reason`) VALUES ('%d','%d', '%d', '%d', '%d', '%s'",
uid,PlayerInfo[playerid][pOwnerUID], PlayerInfo[playerid][pUID], PlayerInfo[admin][pOwnerUID], type, reason);
mysql_query(query);
What is wrong?
Posts: 790
Threads: 7
Joined: Mar 2008
Reputation:
0
Run the query in phpmyadmin. It has better error handling.
Posts: 170
Threads: 10
Joined: Sep 2011
Quote:
Originally Posted by FUNExtreme
Run the query in phpmyadmin. It has better error handling.
|
It's working in phpmyadmin.
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
I doubt that. You're missing a closing bracket at the very end of your query. The log doesn't make that very clear, but if you count the amount of opening brackets and the amount of closing brackets then you'll notice a mismatch.
Posts: 170
Threads: 10
Joined: Sep 2011
Quote:
Originally Posted by Vince
I doubt that. You're missing a closing bracket at the very end of your query. The log doesn't make that very clear, but if you count the amount of opening brackets and the amount of closing brackets then you'll notice a mismatch.
|
Thanks man, problem solved.