Mysql R39-2 Don't save
#1

Hello,

I have a problem, my stats mysql don't save on the database on the deconnection :

Script :

OnplayerDisconnect :

PHP код:
new query[128], Float:pos[3]; 
GetPlayerPos(playerid,pos[0],pos[1],pos[2]); 
mysql_format(mysql,query,sizeof(query),"UPDATE `comptejoueurs` SET `Admin`=%d, `Vip`=%d, `Argent`=%d, `PositionX`=%f, `PositionY`=%f, `PositionZ`=%f WHERE `ID`=%d",\ 
InfoJoueur[playerid][Admin],InfoJoueur[playerid][Vip],InfoJoueur[playerid][Argent],pos[0],pos[1],pos[2], InfoJoueur[playerid][ID]); 
mysql_tquery(mysql,query,"",""); 
printf("%s",query); 
Thanks
Reply
#2

i tested that , try this instead maybe it works :

PHP код:
new query[128], Float:pos[3]; 
GetPlayerPos(playerid,pos[0],pos[1],pos[2]); 
mysql_format(mysql,query,sizeof(query),"UPDATE `comptejoueurs` SET `Admin`=%d, `Vip`=%d, `Argent`=%d, `PositionX`=%f, `PositionY`=%f, `PositionZ`=%f WHERE `ID`=%d",\ 
InfoJoueur[playerid][Admin],InfoJoueur[playerid][Vip],InfoJoueur[playerid][Argent],pos[0],pos[1],pos[2], InfoJoueur[playerid][ID]); 
mysql_tquery(mysql,query); 
printf("%s",query); 
Reply
#3

I think the array size isn't enough.

pawn Код:
new query[0xFF], Float:pos[3];  
GetPlayerPos(playerid,pos[0],pos[1],pos[2]);  

mysql_format(mysql, query, sizeof(query),"UPDATE `comptejoueurs` SET `Admin`=%d, `Vip`=%d, `Argent`=%d, `PositionX`=%f, `PositionY`=%f, `PositionZ`=%f WHERE `ID`=%d",  
    InfoJoueur[playerid][Admin],
    InfoJoueur[playerid][Vip],
    InfoJoueur[playerid][Argent],
    pos[0],pos[1],pos[2],
    InfoJoueur[playerid][ID]
);

mysql_tquery(mysql,query,"","");  
printf("%s",query);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)