MYSQL syntax error
#2

While it's not necessary for integer and float values to be wrapped in single quotes, it is necessary for strings. Some of them in your query are wrapped in single quotes, but some of them aren't and that's what causes the error. Try with this code:

pawn Код:
new formatedmessage[500];
format(Globalquery,sizeof(Globalquery),"INSERT INTO `playerdatabase` (`SQLID`,`Name`,`IP`,`OnlineTime`,`Admin`,");
strcat(Globalquery,"`Helper`,`Character1SQLID`,`Character2SQLID`,`Character3SQLID`,`Pass`,`Banned`,");
strcat(Globalquery,"`BanID`,`ProbationBy`,`ProbationReason`,`ProbationUntil`,`Level`)");
format(formatedmessage,sizeof(formatedmessage)," VALUES (%d,'%s','%s',%d,%d,%d,%d,%d,%d,'%s',%d,%d,'%s','%s',%d,%d)",TotalRegistrations++,PlayerInfo[playerid][AccountName],
PlayerInfo[playerid][IP],OnlineTime, PlayerInfo[playerid][Admin],PlayerInfo[playerid][Helper],PlayerInfo[playerid][CharacterName1],PlayerInfo[playerid][CharacterName2],
PlayerInfo[playerid][CharacterName3],hashed,PlayerInfo[playerid][Banned],-1,"Never","Never",0,0);
strcat(Globalquery,formatedmessage);
mysql_query(Globalquery);
I suggest you update your version of the plugin to R7 or newer, and start using threaded queries with cache.
Reply


Messages In This Thread
MYSQL syntax error - by Enforcer501 - 07.05.2013, 23:49
Re: MYSQL syntax error - by Pooh7 - 08.05.2013, 00:06
Re: MYSQL syntax error - by Enforcer501 - 08.05.2013, 00:09

Forum Jump:


Users browsing this thread: 1 Guest(s)