Help In MySQL
#1

Код:
errorid: 1064 | error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET `Kills` = '0' SET `Deaths` = '0' SET `Rank` = '75' WHERE `Name` = ''' at line 1 | resultid: -1 | extraid: -1 | callback: NULL | query: UPDATE `players` SET `Money` = '0' SET `Kills` = '0' SET `Deaths` = '0' SET `Rank` = '75' WHERE `Name` = ''
pawn Код:
//OnPlayerConnect
new
        Query[90];
    mysql_format(connection,Query,"SELECT `Name` FROM `players` WHERE `Name` = '%e'",GetPlayerNameEx(playerid));
    mysql_query(Query, USER_CHECK, playerid);
//----------------------------------------------------------------------------------//
stock SavePlayerVariables(playerid)
{
    new Query[200];
    format(Query,sizeof(Query),"UPDATE `players` SET `Money` = '%i' SET `Kills` = '%i' SET `Deaths` = '%i' SET `Rank` = '%i' WHERE `Name` = '%s'",GetPlayerMoney(playerid),pInfo[playerid][pKills],pInfo[playerid][pRank],GetPlayerEscapeName(playerid));
    mysql_query(Query);
}

stock LoadPlayerVariables(playerid)
{
    new
        query[200];

    mysql_format(connection,query,"SELECT * FROM `players` WHERE `Name` = '%s'", GetPlayerNameEx(playerid));
    mysql_query(query, LOAD_ACCOUNT_DATA, playerid);
}
I get this error in console when player conects please help :S
Reply
#2

pawn Код:
stock SavePlayerVariables(playerid)
{
    new Query[200];
    format(Query,sizeof(Query),"UPDATE `players` SET `Money` = '%i', `Kills` = '%i', `Deaths` = '%i', `Rank` = '%i' WHERE `Name` = '%s'",GetPlayerMoney(playerid),pInfo[playerid][pKills],pInfo[playerid][pRank],GetPlayerEscapeName(playerid));
    mysql_query(Query);
}
Reply
#3

pawn Код:
stock SavePlayerVariables(playerid)
{
    new Query[200];
    format(Query,sizeof(Query),"UPDATE `players` SET `Money` = '%i', `Kills` = '%i',`Deaths` = '%i', `Rank` = '%i' WHERE `Name` = '%s'",GetPlayerMoney(playerid),pInfo[playerid][pKills],pInfo[playerid][pDeaths], pInfo[playerid][pRank],GetPlayerEscapeName(playerid));
    mysql_query(Query);
}
You forgot to input `Deaths` variable.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)