SQL small help
#1

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.
Reply
#2

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]);
Reply
#3

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)