SA-MP Forums Archive
Getting a SQL error. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Getting a SQL error. (/showthread.php?tid=612539)



Getting a SQL error. - Shockey HD - 19.07.2016

Heres the error:

Код:
CMySQLHandler::Query(UPDATE accounts SET Level=5, Cash=0, bank=0, pX=-955.767211, pY=-490.140380, pZ=25.960937, FAngle=0.000000,Int=0, pVW=70 WHERE Username = '') - 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 'Int=0, pVW=70 WHERE Username = ''' at line 1)
Code:

Код:
        format(query, sizeof(query), "UPDATE accounts SET Level=%d, Cash=%d, bank=%d, pX=%f, pY=%f, pZ=%f, FAngle=%f,Int=%d, pVW=%d WHERE Username = '%s'", pLevel, pCash, pBank,f_PlayerPos[0], f_PlayerPos[1], f_PlayerPos[2], pInterior,pVirtualWorld,pname);
        mysql_query(query);



SOLVED, Can't use "Int" in the structure.


Re: Getting a SQL error. - Misiur - 19.07.2016

You can, just remember to use backticks (`Int`) to specify you want a field called Int, not an integer.