Error in your SQL syntax? All is correct.
#1

pawn Код:
[08:08:45] CMySQLHandler::Query(INSERT INTO `weapons` (WepModel, WepAmmo, WepOwner,WepSerial, WepX, WepY, WepZ, WepEvi, WepDate, WepVW, WepInt) VALUES (30, 250) - 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)

pawn Код:
format(query, sizeof(query), "INSERT INTO `weapons` (WepModel, WepAmmo, WepOwner, WepSerial, WepX, WepY, WepZ, WepEvi, WepDate, WepVW, WepInt) VALUES (%d,250,0,0,0,0,0,0,0,0,0)",WepID[playerid]);
            mysql_query(query);
            new id = mysql_insert_id();
Reply
#2

Код:
format(query, sizeof(query), "INSERT INTO `weapons` (WepModel, WepAmmo, WepOwner, WepSerial, WepX, WepY, WepZ, WepEvi, WepDate, WepVW, WepInt) VALUES ('%d', '250', '0', '0', '0' ,'0' ,'0', '0' ,'0', '0', '0')",WepID[playerid]);
            mysql_query(query);
            new id = mysql_insert_id();
Reply
#3

the length of the variable 'query' is too small. try increasing it to 256, or larger if neccessarry.
Reply
#4

That's not the issue, I use it elsewhere without the ' '!

EDIT: Thanks to the Poster Above.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)