PDA

View Full Version : SQL small help


TwinkiDaBoss
11/07/2015, 04:19 PM
Alright i got a simple problem just cant find it.

Once I add something up to the querry it will stop working entirely.

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.

M4D
11/07/2015, 04:27 PM
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]);

TwinkiDaBoss
11/07/2015, 04:32 PM
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!