Ignore.
#1

I edited the last post.
Reply
#2

It's supposed to, debug it to see what MySQL says

pawn Код:
Printf("%s",SQL_Query);
Don't forget to see if the variable "SQL_Query" has enough size to afford the query lenght.
Reply
#3

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!
Reply
#4

If your using BlueGs plugin try putting this in ONGameModeInit.

pawn Код:
mysql_debug(1);
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() )
Reply
#5

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!
Reply
#6

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.
Reply
#7

THANKS Kikito

It worked, he's right. %d is the one that worked!

<3
Reply
#8

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.
Reply
#9

How do you mean ******?
Reply
#10

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'
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)