SA-MP Forums Archive
[Ajuda] MYSQL nгo salvando - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] MYSQL nгo salvando (/showthread.php?tid=549688)



MYSQL nгo salvando - Justing3 - 08.12.2014

Bom, estou com um problema muito estranho relacionado ao MySQL

Eu nгo to conseguindo salvar nada, mesmo setando.

pawn Код:
mysql_format(g_dbConnection, gstring, sizeof gstring, "UPDATE `player_info` SET `money` = %d, `skin` = %d, `score` = %d, prof` = %d, habt` = %d, haba` = %d, habn` = %d WHERE `id` = %d",
            gPlayerInfo[playerid][playerMoney],
            gPlayerInfo[playerid][playerSkin],
            gPlayerInfo[playerid][playerScore],
            gPlayerInfo[playerid][playerProf],
            gPlayerInfo[playerid][playerHabT],
            gPlayerInfo[playerid][playerHabA],
            gPlayerInfo[playerid][playerHabN],
            gPlayerInfo[playerid][playerID]);
        mysql_function_query(g_dbConnection, gstring, false, #, #);
Exemplo de quando eu seto, mas na hroa de salvar continua = 0

pawn Код:
gPlayerInfo[playerid][playerHabT] = 1;
           
                GivePlayerMoney(playerid, -1000);

                mysql_format(g_dbConnection, gstring, sizeof gstring, "UPDATE `player_info` SET `habt` = 1, money` = %d WHERE `id` = %d", GetPlayerMoney(playerid), gPlayerInfo[playerid][playerID]);
                mysql_function_query(g_dbConnection, gstring, false, #, #);
pawn Код:
g_dbConnection = mysql_connect(DB_HOST, DB_USER, DB_NAME, DB_PASS);
No caso nem a habt e o money estгo salvando


Re: MYSQL nгo salvando - Falcon. - 08.12.2014

Verifique se estб retornando algum erro em OnQueryError, caso nгo a tenha adicione e poste os resultados:

pawn Код:
public OnQueryError(errorid, error[], callback[], query[], connectionHandle)
{
    printf("\n\n\n\n-------------------------------------\n\
    [MYSQL] Ocorreu algum erro durante o uso\n\n\n\
    error_id: %02i - conexaoH: %02i\n\n\
    callback chamada: %s\n\n\
    %s\
    \n\n\n-------------------------------------"
, errorid, connectionHandle, callback, error);
    printf("query: %s", query);
    return 0x01;
}



Re : MYSQL nгo salvando - Justing3 - 08.12.2014

pawn Код:
[12:04:30] [ERROR] ProcessQueryThread() - Erreur de syntaxe prиs de '` = 58 WHERE `id` = 3' а la ligne 1 (error ID: 1064)
No log deu esse erro


Re : MYSQL nгo salvando - Justing3 - 08.12.2014

Tentei pesquisar sobre o assunto porem sу achei results em ingles, e nгo consegue entender bemm...


Re: MYSQL nгo salvando - Falcon. - 08.12.2014

estб faltando um ' antes do prof

`score` = %d, prof` = %d,

tente agora:
pawn Код:
"UPDATE `player_info` SET `money` = %d, `skin` = %d, `score` = %d, `prof` = %d, `habt` = %d, `haba` = %d, `habn` = %d WHERE `id` = %d"



Re: MYSQL nгo salvando - n0minal - 08.12.2014

Код:
58 WHERE `id` = 3'
Erro de sintaxe novamente...