12.02.2014, 16:18
Hi guys, I've got a problem with MySQL: i want to add two new variables into an already existent mysql database but these one aren't saved if a player is already registered. I don't know exactly how Mysql creates variables and so I don't know where i should edit the script.. I post the mysql query on the /register command:
And this one is /login:
The new variables are exp[playerid] and level[playerid]. If a player is new everything going perfect but if a player is already registered i have this problem.. Can you help me? If you need more explanation about my problem just ask!
Thanks
pawn Код:
format(Query, sizeof(Query), "INSERT INTO `users` VALUES('%s', '%s', '%s', '%d', '%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d',%d, '%d', '%d')", escnome, escpass, IPm, cookies[playerid], lvl[playerid],ak[playerid], GetPlayerScore(playerid), GetPlayerMoney(playerid), GetPlayerSkin(playerid),anno,mese,giorno,dpm[playerid],kills[playerid],morti[playerid],vip[playerid],exp[playerid],level[playerid]);
mysql_query(Query);
pawn Код:
mysql_fetch_field_row(datastr,"Cookies"); cookies[playerid] = strval(datastr);
mysql_fetch_field_row(datastr,"Livello"); lvl[playerid] = strval(datastr);
mysql_fetch_field_row(datastr,"AK"); ak[playerid] = strval(datastr);
mysql_fetch_field_row(datastr,"Score"); SetPlayerScore(playerid,strval(datastr));
mysql_fetch_field_row(datastr,"Soldi"); GivePlayerMoney(playerid,strval(datastr));
mysql_fetch_field_row(datastr,"Skin"); SetPlayerSkin(playerid,strval(datastr));
mysql_fetch_field_row(datastr,"PMs"); dpm[playerid] = strval(datastr);
mysql_fetch_field_row(datastr,"Kills"); kills[playerid] = strval(datastr);
mysql_fetch_field_row(datastr,"Morti"); morti[playerid] = strval(datastr);
mysql_fetch_field_row(datastr,"Vip"); vip[playerid] = strval(datastr);
mysql_fetch_field_row(datastr,"exp"); exp[playerid] = strval(datastr);
mysql_fetch_field_row(datastr,"level"); level[playerid] = strval(datastr);
Thanks