Problem...
#1

Can you guys see any problem with this code:
PHP код:
    new saveQuery[2048];
    
format(saveQuerysizeof(saveQuery),"INSERT INTO `users` (`job`,`jobh`,`jobrank`,`paycheck`,`primwea`");
    
format(saveQuerysizeof(saveQuery),"%s,`primweapammo`,`secweap`,`secweapammo`,`melee`,`mask`,`hours`",saveQuery);
    
format(saveQuerysizeof(saveQuery),"%s,`exp`,`level`,`phone`,`skin`,`donatorlvl`,`weplic`,`flylic`,`drivelic`"saveQuery);
    
format(saveQuerysizeof(saveQuery),"%s,`faction`,`rank`,`jailed`,`jtime`,`weed`,`marijuana`,`heroine`,`cocaine`"saveQuery);
    
format(saveQuerysizeof(saveQuery),"%s,`ecstacy`,`bank`,`cash`,`savings`,`bizkey`,`alevel`"saveQuery);
    
format(saveQuerysizeof(saveQuery),"%s,`hkey`,`hkey2`,`hkey3`,`spawn`,`spawnint`,`spawnw`"saveQuery);
    
format(saveQuerysizeof(saveQuery),"%s,`tester`,`vkey`,`vkey2`,`vkey3`,`vkey4`,`vkey5`,`vdkey`,`banned` ) VALUES ("saveQuery);
    
format(saveQuerysizeof(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(saveQuerysizeof(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:0PlayerInfo[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(saveQuerysizeof(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); 
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:
Код:
[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.
Reply
#2

Print the entire query so we can compare it to the error lines returned, because the error lines only print the values of the variables and not the variable names.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)