MySQL - INSERT INTO error
#1

Код 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?
Reply
#2

Run the query in phpmyadmin. It has better error handling.
Reply
#3

Quote:
Originally Posted by FUNExtreme
Посмотреть сообщение
Run the query in phpmyadmin. It has better error handling.
It's working in phpmyadmin.
Reply
#4

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.
Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)