SQL small help - 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: SQL small help (
/showthread.php?tid=581221)
SQL small help -
TwinkiDaBoss - 11.07.2015
Alright i got a simple problem just cant find it.
Once I add something up to the querry it will stop working entirely.
pawn Код:
mysql_format(mysql, query, sizeof(query), "UPDATE `players` SET `Admin`=%d, `VIP`=%d, `Reputation`=%d, `posX`=%f, `posY`=%f, `posZ`=%f, `Score`=%d WHERE `ID`=%d",\
pInfo[playerid][Admin], pInfo[playerid][VIP], pInfo[playerid][Reputation], pos[0], pos[1], pos[2], pInfo[playerid][ID],pInfo[playerid][Score]);
Without the actual score it will work.
Re: SQL small help -
M4D - 11.07.2015
your code:
Код:
`Score`=%d WHERE `ID`=%d"
" pInfo[playerid][ID], pInfo[playerid][Score]"
it should be like:
Код:
" pInfo[playerid][Score], pInfo[playerid][ID]"
Edited Code:
Код:
mysql_format(mysql, query, sizeof(query), "UPDATE `players` SET `Admin`=%d, `VIP`=%d, `Reputation`=%d, `posX`=%f, `posY`=%f, `posZ`=%f, `Score`=%d WHERE `ID`=%d", pInfo[playerid][Admin], pInfo[playerid][VIP], pInfo[playerid][Reputation], pos[0], pos[1], pos[2], pInfo[playerid][Score], pInfo[playerid][ID]);
Re: SQL small help -
TwinkiDaBoss - 11.07.2015
Yeah, I overlooked that but it still doesnt resolve the problem.
Whenever I add that up, the entire SQL saving system stops working aka that line of code basically doesnt work at all then.
EDIT: Works perfectly after I altered few more lines. thanks for the help!