MYSQL QUESTION -
STONEGOLD - 09.07.2015
Well, i don't know whats wrong.
Example:
we 2 players are playing in server.
If player 1 quits his/her game then database saved player 1 stats and it does apply for player 2 also even tho player 2 didn't quit yet.
it's like if any player quit his/her game then it changes all player stats in database as quitter stats.
What kind of problem it is? Do you think it's because i am saving stats as ID? like WHERE ID=%s? Should i saved player stats as NAME? or what.
please reply fast.
Thank you
Re: URGENT MYSQL QUESTION -
Sime30 - 09.07.2015
Give us your Save account data codes here
Re: URGENT MYSQL QUESTION -
ExTaZZ69 - 09.07.2015
ID is a number not a string. Replace %s with %i.
Re: URGENT MYSQL QUESTION -
STONEGOLD - 09.07.2015
==================== fixed
Re: URGENT MYSQL QUESTION -
STONEGOLD - 09.07.2015
anyone? i need it fast
Re: URGENT MYSQL QUESTION -
STONEGOLD - 09.07.2015
==================== fixed
Re: URGENT MYSQL QUESTION -
STONEGOLD - 10.07.2015
Someone please help me.
Re: URGENT MYSQL QUESTION -
STONEGOLD - 10.07.2015
==================== fixed
Re: URGENT MYSQL QUESTION -
STONEGOLD - 10.07.2015
Anyone please help me. It has been 18 hours. IS SAMP DIED?
Re: URGENT MYSQL QUESTION -
CodeStyle175 - 10.07.2015
Pls stop using so long arrays for so small querys.
And ID must be auto increcement
PHP код:
public SavePlayerData(playerid)
{
if(IsLoggedIn[playerid] && IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
new query[200];
mysql_format(mysql,query,sizeof(query),"UPDATE users SET Admin='%d',Donator='%d',RegularPlayer='%d',Money='%d',BankMoney='%d',\
Score='%d',Deaths='%d',Kills='%d' WHERE ID ='%d'",pData[playerid][pAdmin],pData[playerid][pDonator],pData[playerid][pRegularPlayer],
GetPlayerCash(playerid),pData[playerid][pBankMoney],GetPlayerScore(playerid),pData[playerid][pDeaths],pData[playerid][pKills],pData[playerid][pID]);
mysql_tquery(mysql, query);
}
return 1;
}
Re: URGENT MYSQL QUESTION -
STONEGOLD - 10.07.2015
==================== fixed
Re: URGENT MYSQL QUESTION -
STONEGOLD - 10.07.2015
Really so bad. nobody wants to help me. I m stuck at this and I SAID ITS URGENT! Thanks you all.
Re: URGENT MYSQL QUESTION -
CodeStyle175 - 10.07.2015
You have to change this Admin`=%d to Admin='%d'
for every single one
Re: URGENT MYSQL QUESTION -
!damo!spiderman - 10.07.2015
Quote:
Originally Posted by STONEGOLD
Really so bad. nobody wants to help me. I m stuck at this and I SAID ITS URGENT! Thanks you all.
|
So your issue is more important than everyone else's? Would you like me to bring the limo around for you too sir?
Re: URGENT MYSQL QUESTION -
ev0lution - 10.07.2015
Quote:
Originally Posted by CodeStyle175
You have to change this Admin`=%d to Admin='%d'
for every single one
|
No, that is not correct. They are integers. They do not require quotes around them. Similarly, the backticks (`) around the field name are optional, but correct.
Re: URGENT MYSQL QUESTION -
woot - 10.07.2015
You forgot to strcat the last part of your query..
Re: MYSQL QUESTION -
STONEGOLD - 10.07.2015
Which one?
you mean this?
PHP код:
mysql_format(mysql, tmp, sizeof(tmp), "WHERE `Username`= '%s'", Name[playerid] );
mysql_tquery(mysql, query, "", "");
?
Re: MYSQL QUESTION -
CodeStyle175 - 10.07.2015
oh no
PHP код:
mysql_format(mysql, tmp, sizeof(tmp), "WHERE `Username`= '%s'", Name[playerid] );
strcat(query, tmp);
mysql_tquery(mysql, query);
Re: MYSQL QUESTION -
STONEGOLD - 10.07.2015
==================== fixed
Re: MYSQL QUESTION -
STONEGOLD - 10.07.2015
anyone