Pawn Compiler Library has stopped working. [MySQL]
#1

For some reason, pawncc.exe crashes because of this coding...

Код:
     if(Logged[playerid] == 1)
    {
        //If the player disconnects before registering,
        //we want to make sure it doesn't try update
        //so we check if the player is logged in.
        new score = GetPlayerScore(playerid); //Gets players score
        new money = GetPlayerMoney(playerid); //Gets players money
        new query[200], pname[24]; //Creates the variables
        GetPlayerName(playerid, pname, 24); //Gets the players name.
        format(query, sizeof(query), "UPDATE playerdata SET score=%d, money=%d WHERE user='%s'", score, money, pname);
        mysql_query(query);
        //No need to store a result for a update string
Reply
#2

change
Quote:

format(query, sizeof(query), "UPDATE playerdata SET score=%d, money=%d WHERE user='%s'", score, money, pname);

to this
Quote:

format(query, sizeof(query), "UPDATE `playerdata` SET `score` = '%d', `money` = '%d' WHERE `user` = '%s'", score, money, pname);

and make sure to close the brackets
Reply
#3

Still not working, when I comment out those lines, it doesn't crash. But still gives errors (which I will fix)
Reply
#4

If you can't fix them post and i will do my best.
Reply
#5

I just uncommented the lines to see if this was the problem, I still need helping fixing these lines, whatever's wrong with them.
Reply
#6

Show errors, maybe you lost some brackets somewhere?
Reply
#7

I'm no MySQL expert but I believe a connectionhandle under mysql_query is necessary.
Reply
#8

@up
Some plugins don't need connection handle in mysql_query();
Reply
#9

Quote:
Originally Posted by czerwony03
Посмотреть сообщение
@up
Some plugins don't need connection handle in mysql_query();
Most of them do.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)