Daten werden falsch abgespeichert.

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
  • Hey,


    mein nächstes Problem..
    Meine Daten werden immer falsch in meiner Tabelle abgespeichert, obwohl ich bei Registrieren alles auf 0 setze.
    Hier mein Register Dialog:

    Spoiler anzeigen
    case DIALOG_REGISTER1:
    {
    if(response)
    {
    if(strlen(MD5_Hash(inputtext)) == 0)
    {
    new string[300];
    format(string,sizeof(string),"{FEFEFE}Willkommen auf {009BFF}New-Evolution-Reallife{FEFEFE}! Um auf diesem Server spielen zu können,\nmusst du dich nun registrieren. Dadurch erstellst du dir einen Eintrag in die\nDatenbank und kannst jederzeit auf dem Server joinen. {009BFF}Gib dein Passwort ein:");
    ShowPlayerDialog(playerid,DIALOG_REGISTER1,DIALOG_STYLE_PASSWORD,"Registrieren",string,"Registrieren","Abbrechen");
    return 1;
    }
    else
    {
    CreateAccount(playerid,MD5_Hash(inputtext));
    StopAudioStreamForPlayer(playerid);
    SetPVarInt(playerid,"Eingeloggt",1);
    SetSpawnInfo(playerid,0,101,0,0,5,0,0,0,0,0,0,0);
    SetPlayerMoney(playerid,0);
    SetPlayerScore(playerid,1);
    PlayerInfo[playerid][pAdmin] = 0;
    PlayerInfo[playerid][Revo] = 0;
    SpawnPlayer(playerid);
    SavePlayer(playerid);
    return 1;
    }
    }
    else
    {
    Kick(playerid);
    }
    }


    Und mein stock SavePlayer:

    Spoiler anzeigen
    stock SavePlayer(playerid)
    {
    if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
    {
    if(GetPVarInt(playerid,"Eingeloggt") == 1)
    {
    GetPlayerName(playerid, PlayerInfo[playerid][pName], MAX_PLAYER_NAME);
    mysql_SetInt("accounts", "Geld", GetPlayerMoney(playerid), "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Level", GetPlayerScore(playerid), "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "Adminlevel", PlayerInfo[playerid][pAdmin], "Name", PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts", "RevolutionUser", PlayerInfo[playerid][Revo], "Name", PlayerInfo[playerid][pName]);
    }
    }
    return 1;
    }


    Die Tabelle sieht dann aber so aus; ?(


    [table='6']
    [*]Name
    [*]Passwort
    [*]Geld
    [*]Level
    [*]AdminLevel
    [*]RevolutionUser
    [*]Narushi
    [*]202CB962AC59075B964B07152D234B70
    [*]-1
    [*]-1
    [*]-1
    [*]-1
    [/table]


    //push oó

    Einmal editiert, zuletzt von Sh12 ()

  • [table='7']
    [*].
    [*]Name
    [*]Passwort
    [*]Geld
    [*]Level
    [*]AdminLevel
    [*]RevolutionUser
    [*]Type
    [*]varchar
    [*]varchar
    [*]int
    [*]int
    [*]int
    [*]int
    [*]Lenght
    [*]64
    [*]64
    [*]11
    [*]11
    [*]11
    [*]11
    [*]Decimals
    [*]'0'
    [*]'0'
    [*]'0'
    [*]'0'
    [*]'0'
    [*]'0'
    [*]AllowNull
    [*]'0'
    [*]'0'
    [*]'0'
    [*]'0'
    [*]'0'
    [*]'0'
    [*]PrimaryKey
    [*]'1'
    [*]'0'
    [*]'0'
    [*]'0'
    [*]'0'
    [*]'0'
    [/table]

  • Debug

    Spoiler anzeigen
    [06:17:17]
    [06:17:17] ---------------------------
    [06:17:17] MySQL Debugging activated (10/21/12)
    [06:17:17] ---------------------------
    [06:17:17]
    [06:17:17] >> mysql_connect( )
    [06:17:17] CMySQLHandler::CMySQLHandler() - constructor called.
    [06:17:17] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "revo" | Username: "root" ...
    [06:17:17] CMySQLHandler::Connect() - Connection was successful.
    [06:17:17] CMySQLHandler::Connect() - Auto-Reconnect has been enabled.
    [06:17:17] >> mysql_ping( Connection handle: 1 )
    [06:17:17] CMySQLHandler::Ping() - Connection is still alive.
    [06:18:36] >> mysql_reconnect( Connection handle: 1 )
    [06:18:36] CMySQLHandler::Disconnect() - Connection was closed.
    [06:18:37] CMySQLHandler::Connect() - Connection was successful.
    [06:18:37] CMySQLHandler::Connect() - Auto-Reconnect has been enabled.
    [06:18:37] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:37] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
    [06:18:37] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:37] CMySQLHandler::EscapeString(Geld); - Escaped 4 characters to Geld.
    [06:18:37] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:37] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.
    [06:18:37] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:37] CMySQLHandler::EscapeString(Narushi); - Escaped 7 characters to Narushi.
    [06:18:37] >> mysql_query( Connection handle: 1 )
    [06:18:37] CMySQLHandler::Query(SELECT `Geld` FROM `accounts` WHERE `Name` = 'Narushi') - Successfully executed.
    [06:18:37] >> mysql_store_result( Connection handle: 1 )
    [06:18:37] CMySQLHandler::StoreResult() - Result was stored.
    [06:18:37] >> mysql_fetch_int( Connection handle: 1 )
    [06:18:37] >> mysql_free_result( Connection handle: 1 )
    [06:18:37] CMySQLHandler::FreeResult() - Result was successfully free'd.
    [06:18:37] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:37] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
    [06:18:37] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:37] CMySQLHandler::EscapeString(Level); - Escaped 5 characters to Level.
    [06:18:37] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:37] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.
    [06:18:37] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:37] CMySQLHandler::EscapeString(Narushi); - Escaped 7 characters to Narushi.
    [06:18:37] >> mysql_query( Connection handle: 1 )
    [06:18:37] CMySQLHandler::Query(SELECT `Level` FROM `accounts` WHERE `Name` = 'Narushi') - Successfully executed.
    [06:18:37] >> mysql_store_result( Connection handle: 1 )
    [06:18:37] CMySQLHandler::StoreResult() - Result was stored.
    [06:18:37] >> mysql_fetch_int( Connection handle: 1 )
    [06:18:37] >> mysql_free_result( Connection handle: 1 )
    [06:18:37] CMySQLHandler::FreeResult() - Result was successfully free'd.
    [06:18:37] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:37] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
    [06:18:37] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:37] CMySQLHandler::EscapeString(Adminlevel); - Escaped 10 characters to Adminlevel.
    [06:18:37] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:37] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.
    [06:18:37] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:37] CMySQLHandler::EscapeString(Narushi); - Escaped 7 characters to Narushi.
    [06:18:37] >> mysql_query( Connection handle: 1 )
    [06:18:37] CMySQLHandler::Query(SELECT `Adminlevel` FROM `accounts` WHERE `Name` = 'Narushi') - Successfully executed.
    [06:18:37] >> mysql_store_result( Connection handle: 1 )
    [06:18:37] CMySQLHandler::StoreResult() - Result was stored.
    [06:18:37] >> mysql_fetch_int( Connection handle: 1 )
    [06:18:37] >> mysql_free_result( Connection handle: 1 )
    [06:18:37] CMySQLHandler::FreeResult() - Result was successfully free'd.
    [06:18:37] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:37] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
    [06:18:37] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:37] CMySQLHandler::EscapeString(RevolutionUser); - Escaped 14 characters to RevolutionUser.
    [06:18:37] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:37] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.
    [06:18:37] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:37] CMySQLHandler::EscapeString(Narushi); - Escaped 7 characters to Narushi.
    [06:18:37] >> mysql_query( Connection handle: 1 )
    [06:18:37] CMySQLHandler::Query(SELECT `RevolutionUser` FROM `accounts` WHERE `Name` = 'Narushi') - Successfully executed.
    [06:18:37] >> mysql_store_result( Connection handle: 1 )
    [06:18:37] CMySQLHandler::StoreResult() - Result was stored.
    [06:18:37] >> mysql_fetch_int( Connection handle: 1 )
    [06:18:37] >> mysql_free_result( Connection handle: 1 )
    [06:18:37] CMySQLHandler::FreeResult() - Result was successfully free'd.
    [06:18:37] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:37] CMySQLHandler::EscapeString(Narushi); - Escaped 7 characters to Narushi.
    [06:18:37] >> mysql_query( Connection handle: 1 )
    [06:18:37] CMySQLHandler::Query(SELECT * FROM `accounts` WHERE `Name` = 'Narushi') - Successfully executed.
    [06:18:37] >> mysql_store_result( Connection handle: 1 )
    [06:18:37] CMySQLHandler::StoreResult() - Result was stored.
    [06:18:37] >> mysql_num_rows( Connection handle: 1 )
    [06:18:37] CMySQLHandler::NumRows() - Returned 0 row(s)
    [06:18:37] >> mysql_free_result( Connection handle: 1 )
    [06:18:37] CMySQLHandler::FreeResult() - Result was successfully free'd.
    [06:18:39] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:39] CMySQLHandler::EscapeString(Narushi); - Escaped 7 characters to Narushi.
    [06:18:39] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:39] CMySQLHandler::EscapeString(202CB962AC59075B964B07152D234B70); - Escaped 32 characters to 202CB962AC59075B964B07152D234B70.
    [06:18:39] >> mysql_query( Connection handle: 1 )
    [06:18:39] CMySQLHandler::Query(INSERT INTO `accounts` (`Name`, `Passwort`) VALUES ('Narushi', '202CB962AC59075B964B07152D234B70')) - Successfully executed.
    [06:18:39] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:39] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
    [06:18:39] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:39] CMySQLHandler::EscapeString(Geld); - Escaped 4 characters to Geld.
    [06:18:39] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:39] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.
    [06:18:39] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:39] CMySQLHandler::EscapeString(Narushi); - Escaped 7 characters to Narushi.
    [06:18:39] >> mysql_query( Connection handle: 1 )
    [06:18:39] CMySQLHandler::Query(UPDATE `accounts` SET `Geld` = '-1' WHERE `Name` = 'Narushi') - Successfully executed.
    [06:18:39] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:39] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
    [06:18:39] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:39] CMySQLHandler::EscapeString(Level); - Escaped 5 characters to Level.
    [06:18:39] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:39] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.
    [06:18:39] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:39] CMySQLHandler::EscapeString(Narushi); - Escaped 7 characters to Narushi.
    [06:18:39] >> mysql_query( Connection handle: 1 )
    [06:18:39] CMySQLHandler::Query(UPDATE `accounts` SET `Level` = '-1' WHERE `Name` = 'Narushi') - Successfully executed.
    [06:18:39] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:39] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
    [06:18:39] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:39] CMySQLHandler::EscapeString(Adminlevel); - Escaped 10 characters to Adminlevel.
    [06:18:39] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:39] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.
    [06:18:39] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:39] CMySQLHandler::EscapeString(Narushi); - Escaped 7 characters to Narushi.
    [06:18:39] >> mysql_query( Connection handle: 1 )
    [06:18:39] CMySQLHandler::Query(UPDATE `accounts` SET `Adminlevel` = '-1' WHERE `Name` = 'Narushi') - Successfully executed.
    [06:18:39] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:39] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
    [06:18:39] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:39] CMySQLHandler::EscapeString(RevolutionUser); - Escaped 14 characters to RevolutionUser.
    [06:18:39] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:39] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.
    [06:18:39] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:39] CMySQLHandler::EscapeString(Narushi); - Escaped 7 characters to Narushi.
    [06:18:39] >> mysql_query( Connection handle: 1 )
    [06:18:39] CMySQLHandler::Query(UPDATE `accounts` SET `RevolutionUser` = '-1' WHERE `Name` = 'Narushi') - Successfully executed.
    [06:18:45] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:45] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
    [06:18:45] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:45] CMySQLHandler::EscapeString(Geld); - Escaped 4 characters to Geld.
    [06:18:45] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:45] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.
    [06:18:45] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:45] CMySQLHandler::EscapeString(Narushi); - Escaped 7 characters to Narushi
    [06:18:45] >> mysql_query( Connection handle: 1 )
    [06:18:45] CMySQLHandler::Query(UPDATE `accounts` SET `Geld` = '-1' WHERE `Name` = 'Narushi') - Successfully executed.
    [06:18:45] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:45] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
    [06:18:45] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:45] CMySQLHandler::EscapeString(Level); - Escaped 5 characters to Level.
    [06:18:45] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:45] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.
    [06:18:45] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:45] CMySQLHandler::EscapeString(Narushi); - Escaped 7 characters to Narushi.
    [06:18:45] >> mysql_query( Connection handle: 1 )
    [06:18:45] CMySQLHandler::Query(UPDATE `accounts` SET `Level` = '-1' WHERE `Name` = 'Narushi') - Successfully executed.
    [06:18:45] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:45] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
    [06:18:45] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:45] CMySQLHandler::EscapeString(Adminlevel); - Escaped 10 characters to Adminlevel.
    [06:18:45] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:45] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.
    [06:18:45] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:45] CMySQLHandler::EscapeString(Narushi); - Escaped 7 characters to Narushi.
    [06:18:45] >> mysql_query( Connection handle: 1 )
    [06:18:45] CMySQLHandler::Query(UPDATE `accounts` SET `Adminlevel` = '-1' WHERE `Name` = 'Narushi') - Successfully executed.
    [06:18:45] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:45] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.
    [06:18:45] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:45] CMySQLHandler::EscapeString(RevolutionUser); - Escaped 14 characters to RevolutionUser.
    [06:18:45] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:45] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.
    [06:18:45] >> mysql_real_escape_string( Connection handle: 1 )
    [06:18:45] CMySQLHandler::EscapeString(Narushi); - Escaped 7 characters to Narushi.
    [06:18:45] >> mysql_query( Connection handle: 1 )
    [06:18:45] CMySQLHandler::Query(UPDATE `accounts` SET `RevolutionUser` = '-1' WHERE `Name` = 'Narushi') - Successfully executed.