08.05.2013, 00:06
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:
I suggest you update your version of the plugin to R7 or newer, and start using threaded queries with cache.
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);

