02.08.2011, 16:08
Can you guys see any problem with this code:
It's inside a stock that saves the player's info into the SQL server before he logs off and when I call it this is what the console writes:
PHP код:
new saveQuery[2048];
format(saveQuery, sizeof(saveQuery),"INSERT INTO `users` (`job`,`jobh`,`jobrank`,`paycheck`,`primwea`");
format(saveQuery, sizeof(saveQuery),"%s,`primweapammo`,`secweap`,`secweapammo`,`melee`,`mask`,`hours`",saveQuery);
format(saveQuery, sizeof(saveQuery),"%s,`exp`,`level`,`phone`,`skin`,`donatorlvl`,`weplic`,`flylic`,`drivelic`", saveQuery);
format(saveQuery, sizeof(saveQuery),"%s,`faction`,`rank`,`jailed`,`jtime`,`weed`,`marijuana`,`heroine`,`cocaine`", saveQuery);
format(saveQuery, sizeof(saveQuery),"%s,`ecstacy`,`bank`,`cash`,`savings`,`bizkey`,`alevel`", saveQuery);
format(saveQuery, sizeof(saveQuery),"%s,`hkey`,`hkey2`,`hkey3`,`spawn`,`spawnint`,`spawnw`", saveQuery);
format(saveQuery, sizeof(saveQuery),"%s,`tester`,`vkey`,`vkey2`,`vkey3`,`vkey4`,`vkey5`,`vdkey`,`banned` ) VALUES (", saveQuery);
format(saveQuery, sizeof(saveQuery),"%s,'%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i'",
saveQuery,PlayerInfo[playerid][pJob],PlayerInfo[playerid][pJobH],PlayerInfo[playerid][pJobRank],PlayerInfo[playerid][pPayCheck],
PlayerInfo[playerid][pPrimWeap],PlayerInfo[playerid][pPrimWeapA],PlayerInfo[playerid][pSecWeap],PlayerInfo[playerid][pSecWeapA],
PlayerInfo[playerid][pMelee] = 0,PlayerInfo[playerid][pMask] = 0,PlayerInfo[playerid][pHours],PlayerInfo[playerid][pExp],
PlayerInfo[playerid][pLevel],PlayerInfo[playerid][pPhone],PlayerInfo[playerid][pSkin],PlayerInfo[playerid][pDonlvl],
PlayerInfo[playerid][pWeplic] ? 1:0);
format(saveQuery, sizeof(saveQuery),"%s,'%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i'",
saveQuery,PlayerInfo[playerid][pFlylic] ? 1:0, PlayerInfo[playerid][pDrivelic] ? 1:0,PlayerInfo[playerid][pWeed],PlayerInfo[playerid][pMarijuana],PlayerInfo[playerid][pHeroine],
PlayerInfo[playerid][pCocaine],PlayerInfo[playerid][pEcstacy],PlayerInfo[playerid][pBank],PlayerInfo[playerid][pCash],PlayerInfo[playerid][pSavings],
PlayerInfo[playerid][pBizKey],PlayerInfo[playerid][pAdmin],PlayerInfo[playerid][pHKey][0],PlayerInfo[playerid][pHKey][1],PlayerInfo[playerid][pHKey][2]);
format(saveQuery, sizeof(saveQuery),"%s,'%.1f,%.1f,%.1f','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i');",
saveQuery,PlayerInfo[playerid][pSpawn],PlayerInfo[pSpawnI],PlayerInfo[playerid][pSpawnW],PlayerInfo[playerid][pTester],
PlayerInfo[playerid][pVKey][0],PlayerInfo[playerid][pVKey][1],PlayerInfo[playerid][pVKey][2],PlayerInfo[playerid][pVKey][3],PlayerInfo[playerid][pVKey][4],
PlayerInfo[playerid][pDKey],PlayerInfo[playerid][pBanned]);
mysql_query(saveQuery);
Код:
[18:04:45] [MySQL] Error (0): Failed to exeute query. 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 ''0','0','0','0','30','0','23','0','0','0','0','0','1','0','26','0','0','0','0','' at line 1. [18:04:45] [MySQL] Error (0): Failed to exeute query. 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 ''0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0',' at line 1.