MySQL speichert nicht? Liest nur aus

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hallo liebe User,


    ich wollte einfach nur das jeder Account gespeichert wird, wenn man sich ausloggt oder wenn man den Server ausmacht /abstürzt.
    Bei mir wird aber nichts gespeichert, geladen werden sie aber richtig(also Adminlevel). Das wird aber nur geladen, weil ich das in der Datenbank selber eingetragen habe.
    Also ich glaube das in der MySQL nichts überschrieben wird. Außerdem kann ich kein Car löschen.
    Code:

    http://pastebin.com/f39HrVNv

    Einmal editiert, zuletzt von Teddypain () aus folgendem Grund: Rexschreibfäler

  • @Shain™:[18:54:42] >> mysql_connect(127.0.0.1, root, samp, ******) on port 3306:[18:54:42] CMySQLHandler::CMySQLHandler() - constructor called.
    [18:54:42] CMySQLHandler::CMySQLHandler() - Connecting to "127.0.0.1" | DB: "samp" | Username: "root"
    [18:54:42] CMySQLHandler::Connect() - Connection was successful.
    [18:54:42] CMySQLHandler::Connect() - Auto-Reconnect has been enabled.
    [18:55:15] >> mysql_query_callback( Connection handle: 1 )
    [18:55:15] Passing query SELECT id FROM user WHERE username='Teddypain' | i
    [18:55:15] ProcessQueryThread(OnUserCheck) - Query was successful. (SELECT id FROM user WHERE username='Teddypain')
    [18:55:15] ProcessQueryThread(OnUserCheck) - Data caching enabled.
    [18:55:15] CMySQLHandler::StoreResult() - Result was stored.
    [18:55:15] CMySQLHandler::FreeResult() - Result was successfully free'd.
    [18:55:15] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
    [18:55:15] OnUserCheck(i) - Threaded function called.
    [18:55:15] >> cache_get_data( Connection handle: 1 )
    [18:55:15] ProcessTick() - The cache has been cleared.
    [18:55:16] >> mysql_real_escape_string( Connection handle: 1 )
    [18:55:16] CMySQLHandler::EscapeString(1234); - Escaped 4 characters to 1234.
    [18:55:16] >> mysql_query_callback( Connection handle: 1 )
    [18:55:16] Passing query SELECT * FROM user WHERE username='Teddypain' AND password=MD5('1234') | i
    [18:55:16] ProcessQueryThread(OnPasswordResponse) - Query was successful. (SELECT * FROM user WHERE username='Teddypain' AND password=MD5('1234'))
    [18:55:16] ProcessQueryThread(OnPasswordResponse) - Data caching enabled.
    [18:55:16] CMySQLHandler::StoreResult() - Result was stored.
    [18:55:16] CMySQLHandler::FreeResult() - Result was successfully free'd.
    [18:55:16] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
    [18:55:16] OnPasswordResponse(i) - Threaded function called.
    [18:55:16] >> cache_get_data( Connection handle: 1 )
    [18:55:16] >> mysql_query_callback( Connection handle: 1 )
    [18:55:16] ProcessTick() - The cache has been cleared.
    [18:55:16] Passing query SELECT * FROM autos WHERE besitzer='0' | i
    [18:55:16] ProcessQueryThread(OnPlayerCarsLoad) - Query was successful. (SELECT * FROM autos WHERE besitzer='0')
    [18:55:16] ProcessQueryThread(OnPlayerCarsLoad) - Data caching enabled.
    [18:55:16] CMySQLHandler::StoreResult() - Result was stored.
    [18:55:16] CMySQLHandler::FreeResult() - Result was successfully free'd.
    [18:55:16] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
    [18:55:16] OnPlayerCarsLoad(i) - Threaded function called.
    [18:55:16] >> cache_get_data( Connection handle: 1 )
    [18:55:16] ProcessTick() - The cache has been cleared.
    [18:55:23] >> mysql_query_callback( Connection handle: 1 )
    [18:55:23] >> mysql_query_callback( Connection handle: 1 )
    [18:55:23] Passing query UPDATE autos SET x='1215.000000',y='-916.000915',z='42.256061',r='187.338272' WHERE id='1' |
    [18:55:23] ProcessQueryThread() - Query was successful. (UPDATE autos SET x='1215.000000',y='-916.000915',z='42.256061',r='187.338272' WHERE id='1')
    [18:55:23] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
    [18:55:23] Passing query UPDATE autos SET x='1214.999633',y='-916.000000',z='42.247196',r='187.169906' WHERE id='2' |
    [18:55:24] ProcessQueryThread() - Query was successful. (UPDATE autos SET x='1214.999633',y='-916.000000',z='42.247196',r='187.169906' WHERE id='2')
    [18:55:24] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()

    Hey, ich habe noch den Vorschlag bekommen das zu tun :
    savePlayer(playerid)
    {
    if(pInfo[playerid][eingeloggt] == 0)return 1;
    //Speichern; level,money,admin,fraktion,rang,spawn
    new query[9900];
    format(query,sizeof(query),"UPDATE user SET pLevel='%i',pMoney='%i',pAdmin='%i',pFraktion='%i',pRang='%i',pSpawn='%i' WHERE username='%s'",
    pInfo[playerid][pLevel],GetPlayerMoney(playerid),pInfo[playerid][pAdmin],pInfo[playerid][pFraktion],pInfo[playerid][pRang],pInfo[playerid][pSpawn],pInfo[playerid][db_id]);
    mysql_function_query(dbhandle,query,false,"","");
    return 1;
    }
    zu
    savePlayer(playerid)
    {
    if(pInfo[playerid][eingeloggt] == 0)return 1;
    //Speichern; level,money,admin,fraktion,rang,spawn
    new query[300];
    format(query,sizeof(query),"UPDATE user SET pLevel='%i',pMoney='%i',pAdmin='%i',pFraktion='%i',pRang='%i',pSpawn='%i' WHERE id ='%i'",
    pInfo[playerid][pLevel],GetPlayerMoney(playerid),pInfo[playerid][pAdmin],pInfo[playerid][pFraktion],pInfo[playerid][pRang],pInfo[playerid][pSpawn],pInfo[playerid][db_id]);
    mysql_function_query(dbhandle,query,false,"","");
    return 1;
    }

    3 Mal editiert, zuletzt von Teddypain () aus folgendem Grund: Falsch gecodet Habe noch eine Hilfe bekommen, funktioniert aber nicht :(