Hi
ich habe ein Kleines Problem und zwar wollte ich die FraktionID mit speichern aber MySQL spuckt mir nun Errors aus allerdings kann ich mich nicht erklären warum..
[ERROR] error #1064 while executing query "UPDATE users SET level = '5', money = '300', kills = '0', deaths = '0', admin = '5', fraktionID = '0', WHERE id = '1'": You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE id = '1'' at line 1
enum pDataEnum
{
p_id,
bool:pLoggedIn,
pName[MAX_PLAYER_NAME],
pLevel,
pMoney,
pKills,
pDeaths,
pAdmin,
pFraktion
}
new PlayerInfo[MAX_PLAYERS][pDataEnum];
cache_get_value_name_int(0, "id", PlayerInfo[playerid][p_id]);
cache_get_value_name_int(0, "level", PlayerInfo[playerid][pLevel]);
cache_get_value_name_int(0, "money", PlayerInfo[playerid][pMoney]);
cache_get_value_name_int(0, "kills", PlayerInfo[playerid][pKills]);
cache_get_value_name_int(0, "deaths", PlayerInfo[playerid][pDeaths]);
cache_get_value_name_int(0, "admin", PlayerInfo[playerid][pAdmin]);
cache_get_value_name_int(0, "fraktionID", PlayerInfo[playerid][pFraktion]);
PlayerInfo[playerid][pLoggedIn] = true;
SendClientMessage(playerid, 0x00FF00FF, "[Konto] Eingeloggt.");
GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
SpawnPlayer(playerid);
}
return 1;
}
stock SaveUserStats(playerid)
{
//Wenn der Spieler nicht eingeloggt ist, dann speichere seine Statistiken nicht
if(!PlayerInfo[playerid][pLoggedIn]) return 1;
//Ansonsten speichere sie
new query[500];
mysql_format(handle, query, sizeof(query), "UPDATE users SET level = '%d', money = '%d', kills = '%d', deaths = '%d', admin = '%d', fraktionID = '%d', WHERE id = '%d'",
PlayerInfo[playerid][pLevel], GetPlayerMoney(playerid), PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pFraktion], PlayerInfo[playerid][p_id]);
print("test");
//Das Query wird abgesendet
mysql_pquery(handle, query);
return 1;
}
hat jemand einen plan?