Help -
iGetty - 22.05.2012
I edited the last post.
Re: Ignore. -
Ruben_Alonso - 22.05.2012
It's supposed to, debug it to see what MySQL says
Don't forget to see if the variable "SQL_Query" has enough size to afford the query lenght.
Re: Ignore. -
iGetty - 22.05.2012
I've got this mate:
pawn Код:
stock SaveStats(playerid)
{
format(SQL_Query,sizeof(SQL_Query),"UPDATE `Accounts` SET `IP` = '%s', `Money` = '%i', `Level` = '%i', `AdminLevel` = '%i', `Faction` = '%i', `FactionRank` = '%i' WHERE `Username` = '%s'",
Player[playerid][Ip],
Player[playerid][Money],
Player[playerid][Level],
Player[playerid][AdminLevel],
Player[playerid][Faction],
Player[playerid][FactionRank],
pName(playerid));
print(SQL_Query);
mysql_query(SQL_Query);
mysql_free_result();
printf("%s", SQL_Query);
return 1;
}
I fixed the first error, this time it's saving the items in the wrong place?
Say, it's saving the AdminLevel amount in FactionRank..?
What's wrong?
Thanks!
Re: Ignore. -
iggy1 - 22.05.2012
If your using BlueGs plugin try putting this in ONGameModeInit.
It creates a file called mysql_log.txt in your server directory, see what is happening in that file when you run this code.
There's also no point in freeing the result there because UPDATE queries don't return data. (you never use mysql_store_result() )
Re: Ignore. - kikito - 22.05.2012
pawn Код:
format(SQL_Query,sizeof(SQL_Query),"UPDATE `Accounts` SET `IP` = '%s', `Money` = '%d', `Level` = '%d', `AdminLevel` = '%d', `Faction` = '%d', `FactionRank` = '%d' WHERE `Username` = '%s'", // continue your format code
%d are for the numbers(int) and %s for the vchar.
I hope it works buddy!
Re: Ignore. -
iggy1 - 22.05.2012
Quote:
Originally Posted by kikito
pawn Код:
format(SQL_Query,sizeof(SQL_Query),"UPDATE `Accounts` SET `IP` = '%s', `Money` = '%d', `Level` = '%d', `AdminLevel` = '%d', `Faction` = '%d', `FactionRank` = '%d' WHERE `Username` = '%s'", // continue your format code
%d are for the numbers(int) and %s for the vchar.
I hope it works buddy!
|
%i is also for integer.
Re: Ignore. -
iGetty - 22.05.2012
THANKS Kikito
It worked, he's right. %d is the one that worked!
<3
Re: Ignore. - kikito - 22.05.2012
Quote:
Originally Posted by ******
Well now how are people searching for answers to this question meant to find them?
|
I really don't know.
I've just helped him.
Re: Ignore. -
iGetty - 22.05.2012
How do you mean ******?
Re: Ignore. -
kaisersouse - 22.05.2012
People who help people get incredibly annoyed when the people who need help do this sort of thing. We encourage people to search for possible answers to their problems...searching doesnt work when the initial problem is removed.
It would be cool if you put the problem back in your first post. Just sayin'