MySQL Accounts kopieren sich untereinander

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
  • Ich habe ein Großes problem -.-


    ich arbeite mit MySQL und ständig kopieren sich die accounts untereinander
    das heißt account werner hat 500k ein neuer account namens gerda hat 10k
    sobald gerda reloggt hat sie auch 500k


    ich versuche seit Tagen den fehler zu finden und ich finde ihn nicht


    ich hoffe, das ihr mir helfen könnt


    hier mal die code´s
    stock InMySQL()
    {
    mysql_debug(SQL_Degb);
    return mysql_connect(SQL_Host,SQL_User,SQL_DatB,SQL_Pass);
    }


    stock CreateSql()
    {
    mysql_query("INSERT IGNORE INTO `player` () VALUES ();");
    return mysql_insert_id();
    }


    stock GetPlayerIdFromName(name[])
    {
    new query[128],ID[15];
    mysql_real_escape_string(name, name);
    format(query, sizeof query, "SELECT `ID` FROM `player` WHERE `name` = '%s' LIMIT 1;", name);
    mysql_query(query);
    mysql_store_result();
    if(!mysql_num_rows())
    {
    mysql_free_result();
    return -1;
    }
    mysql_fetch_row(query);
    mysql_fetch_field_row(ID,"ID");
    mysql_free_result();
    return strval(ID);
    }


    stock mysql_SetInt(ID,what[],value)
    {
    ID = GetPlayerId(ID);
    if(ID < 1)
    return false;
    new query[128];
    SetPVarInt(ID, what, value);
    format(query, sizeof query, "UPDATE `player` SET `%s` = %i WHERE `ID` = %i LIMIT 1;",what,value,ID);
    return mysql_query(query);
    }


    stock mysql_SetFloat(ID,what[],Float:value)
    {
    ID = GetPlayerId(ID);
    if(ID < 1)
    return false;
    new query[128];
    SetPVarFloat(ID, what, value);
    format(query, sizeof query, "UPDATE `player` SET `%s` = '%f' WHERE `ID` = %i LIMIT 1;",what,value,ID);
    return mysql_query(query);
    }


    stock mysql_Set(ID,what[],value[])
    {
    ID = GetPlayerId(ID);
    if(ID < 1)
    return false;
    new query[128];
    SetPVarString(ID, what, value);
    mysql_real_escape_string(value, value);
    format(query, sizeof query, "UPDATE `player` SET `%s` = '%s' WHERE `ID` = '%i' LIMIT 1;",what,value,ID);
    return mysql_query(query);
    }


    stock mysql_Get(id, what[])
    {
    id = GetPlayerId(id);
    new query[128],
    response[256];
    if(id < 1)
    return response;
    format(query, sizeof query, "SELECT `%s` FROM `player` WHERE `id` = %i LIMIT 1;",what,id);
    mysql_query(query);
    mysql_store_result();
    mysql_fetch_row(query);
    mysql_fetch_field_row(response, what);
    mysql_free_result();
    return response;
    }


    MFG
    Merte

  • if(dialogid==DIALOG_LOGIN)
    {
    if(response==0)
    {
    SendClientMessage(playerid,cBlue,"Du hast den Vorgang abgebrochen.");
    Kick(playerid);
    return 1;
    }
    if(response==1)
    {
    if(!strlen(inputtext))
    {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    new string[128];
    format(string,sizeof(string),"{FFFFFF}Das Passwort war falsch{FF6E00} %s \n{FFFFFF}um wieder an das Spiel teilzunehmen\nGeben sie ihr Passwort ein.\n\n© 2012 by PowerPlay",name);
    ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login bei GTA-PowerPlay",string,"Login","Abbrechen");
    return 1;
    }
    else
    {
    Login(playerid,MD5_Hash(inputtext));
    return 1;
    }
    }
    }
    if(dialogid==DIALOG_REGISTER)
    {
    if(response==0)
    {
    SendClientMessage(playerid,cRed,"Du hast den Vorgang abgebrochen.");
    Kick(playerid);
    return 1;
    }
    if(response==1)
    {
    if(!strlen(inputtext))//SetPVarInt(playerid,"Login",+1);
    {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    new string[128];
    format(string,sizeof(string),"{FFFFFF}Der Account{FF6E00} %s {FFFFFF}wurde nicht gefunden.\nBitte geben sie nun ein gültiges Passwort ein\nEs sollte mindestens 6 Buchstaben/Zahlen haben!",name);
    ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Registrieren",string,"Register","Abbrechen");
    return 1;
    }
    else
    {
    Register(playerid,MD5_Hash(inputtext));
    return 1;
    }
    }
    }

  • Ich habe jetzt mal die eigendlich sinnlose abfrage ausgeklammert gehabt


    ID = GetPlayerId(ID);


    nur dann hab ich das Problem das die Tabellen leer bleiben sprich es wird nix weiter gespeichert


    //Edit
    der Debug sieht sauber aus aber die Tabelle bleibt leer
    [20:21:06] ---------------------------


    [20:21:06] MySQL Debugging activated (02/26/12)


    [20:21:06] ---------------------------


    [20:21:06]


    [20:21:42] >> mysql_real_escape_string( Connection handle: 1 )


    [20:21:42] CMySQLHandler::EscapeString(hans); - Escaped 4 characters to hans.


    [20:21:42] >> mysql_query( Connection handle: 1 )


    [20:21:42] CMySQLHandler::Query(SELECT `ID` FROM `player` WHERE `name` = 'hans' LIMIT 1;) - Successfully executed.


    [20:21:42] >> mysql_store_result( Connection handle: 1 )


    [20:21:42] CMySQLHandler::StoreResult() - Result was stored.


    [20:21:42] >> mysql_num_rows( Connection handle: 1 )


    [20:21:42] CMySQLHandler::NumRows() - Returned 0 row(s)


    [20:21:42] >> mysql_free_result( Connection handle: 1 )


    [20:21:42] CMySQLHandler::FreeResult() - Result was successfully free'd.


    [20:23:37] >> mysql_real_escape_string( Connection handle: 1 )


    [20:23:37] CMySQLHandler::EscapeString(hans); - Escaped 4 characters to hans.


    [20:23:37] >> mysql_query( Connection handle: 1 )


    [20:23:37] CMySQLHandler::Query(SELECT `ID` FROM `player` WHERE `name` = 'hans' LIMIT 1;) - Successfully executed.


    [20:23:37] >> mysql_store_result( Connection handle: 1 )


    [20:23:37] CMySQLHandler::StoreResult() - Result was stored.


    [20:23:37] >> mysql_num_rows( Connection handle: 1 )


    [20:23:37] CMySQLHandler::NumRows() - Returned 0 row(s)


    [20:23:37] >> mysql_free_result( Connection handle: 1 )


    [20:23:37] CMySQLHandler::FreeResult() - Result was successfully free'd.


    [20:23:37] >> mysql_query( Connection handle: 1 )


    [20:23:37] CMySQLHandler::Query(INSERT IGNORE INTO `player` () VALUES ();) - Successfully executed.


    [20:23:37] >> mysql_insert_id( Connection handle: 1 )


    [20:23:37] >> mysql_real_escape_string( Connection handle: 1 )


    [20:23:37] CMySQLHandler::EscapeString(hans); - Escaped 4 characters to hans.


    [20:23:37] >> mysql_query( Connection handle: 1 )


    [20:23:37] CMySQLHandler::Query(UPDATE `player` SET `Name` = 'hans' WHERE `ID` = '3' LIMIT 1;) - Successfully executed.


    [20:23:37] >> mysql_real_escape_string( Connection handle: 1 )


    [20:23:37] CMySQLHandler::EscapeString(BB545561110F9A827AB21F8586566205); - Escaped 32 characters to BB545561110F9A827AB21F8586566205.


    [20:23:37] >> mysql_query( Connection handle: 1 )


    [20:23:38] CMySQLHandler::Query(UPDATE `player` SET `Passwort` = 'BB545561110F9A827AB21F8586566205' WHERE `ID` = '3' LIMIT 1;) - Successfully executed.


    [20:23:38] >> mysql_query( Connection handle: 1 )


    [20:23:38] CMySQLHandler::Query(UPDATE `player` SET `Payday` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:38] >> mysql_query( Connection handle: 1 )


    [20:23:38] CMySQLHandler::Query(UPDATE `player` SET `Monate` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:38] >> mysql_query( Connection handle: 1 )


    [20:23:38] CMySQLHandler::Query(UPDATE `player` SET `Level` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:38] >> mysql_query( Connection handle: 1 )


    [20:23:38] CMySQLHandler::Query(UPDATE `player` SET `Geld` = 10000 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:38] >> mysql_query( Connection handle: 1 )


    [20:23:38] CMySQLHandler::Query(UPDATE `player` SET `Adminlevel` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:38] >> mysql_query( Connection handle: 1 )


    [20:23:38] CMySQLHandler::Query(UPDATE `player` SET `Warn` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:38] >> mysql_query( Connection handle: 1 )


    [20:23:38] CMySQLHandler::Query(UPDATE `player` SET `Baned` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:38] >> mysql_query( Connection handle: 1 )


    [20:23:39] CMySQLHandler::Query(UPDATE `player` SET `Bank` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:39] >> mysql_query( Connection handle: 1 )


    [20:23:39] CMySQLHandler::Query(UPDATE `player` SET `Job` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:39] >> mysql_query( Connection handle: 1 )


    [20:23:39] CMySQLHandler::Query(UPDATE `player` SET `Car` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:39] >> mysql_query( Connection handle: 1 )


    [20:23:39] CMySQLHandler::Query(UPDATE `player` SET `Bike` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:39] >> mysql_query( Connection handle: 1 )


    [20:23:39] CMySQLHandler::Query(UPDATE `player` SET `Lkw` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:39] >> mysql_query( Connection handle: 1 )


    [20:23:39] CMySQLHandler::Query(UPDATE `player` SET `Boot` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:39] >> mysql_query( Connection handle: 1 )


    [20:23:39] CMySQLHandler::Query(UPDATE `player` SET `Fly` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:39] >> mysql_query( Connection handle: 1 )


    [20:23:39] CMySQLHandler::Query(UPDATE `player` SET `Heli` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:39] >> mysql_query( Connection handle: 1 )


    [20:23:39] CMySQLHandler::Query(UPDATE `player` SET `Skin` = 26 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:39] >> mysql_query( Connection handle: 1 )


    [20:23:40] CMySQLHandler::Query(UPDATE `player` SET `Leader` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:40] >> mysql_query( Connection handle: 1 )


    [20:23:40] CMySQLHandler::Query(UPDATE `player` SET `Member` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:40] >> mysql_query( Connection handle: 1 )


    [20:23:40] CMySQLHandler::Query(UPDATE `player` SET `Rank` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:40] >> mysql_query( Connection handle: 1 )


    [20:23:40] CMySQLHandler::Query(UPDATE `player` SET `Payday` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:40] >> mysql_query( Connection handle: 1 )


    [20:23:40] CMySQLHandler::Query(UPDATE `player` SET `Monate` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:40] >> mysql_query( Connection handle: 1 )


    [20:23:40] CMySQLHandler::Query(UPDATE `player` SET `Ticket` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:40] >> mysql_query( Connection handle: 1 )


    [20:23:40] CMySQLHandler::Query(UPDATE `player` SET `Nummer` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:40] >> mysql_query( Connection handle: 1 )


    [20:23:40] CMySQLHandler::Query(UPDATE `player` SET `Vertrag` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:23:40] >> mysql_query( Connection handle: 1 )


    [20:23:41] CMySQLHandler::Query(UPDATE `player` SET `Wanted` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:28] >> mysql_query( Connection handle: 1 )


    [20:25:28] CMySQLHandler::Query(UPDATE `player` SET `Level` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:28] >> mysql_query( Connection handle: 1 )


    [20:25:28] CMySQLHandler::Query(UPDATE `player` SET `Geld` = 9000 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:28] >> mysql_query( Connection handle: 1 )


    [20:25:28] CMySQLHandler::Query(UPDATE `player` SET `Adminlevel` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:28] >> mysql_query( Connection handle: 1 )


    [20:25:28] CMySQLHandler::Query(UPDATE `player` SET `Warn` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:28] >> mysql_query( Connection handle: 1 )


    [20:25:28] CMySQLHandler::Query(UPDATE `player` SET `Baned` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:28] >> mysql_query( Connection handle: 1 )


    [20:25:28] CMySQLHandler::Query(UPDATE `player` SET `Bank` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:28] >> mysql_query( Connection handle: 1 )


    [20:25:28] CMySQLHandler::Query(UPDATE `player` SET `Job` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:28] >> mysql_query( Connection handle: 1 )


    [20:25:29] CMySQLHandler::Query(UPDATE `player` SET `Car` = 1 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:29] >> mysql_query( Connection handle: 1 )


    [20:25:29] CMySQLHandler::Query(UPDATE `player` SET `Bike` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:29] >> mysql_query( Connection handle: 1 )


    [20:25:29] CMySQLHandler::Query(UPDATE `player` SET `Lkw` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:29] >> mysql_query( Connection handle: 1 )


    [20:25:29] CMySQLHandler::Query(UPDATE `player` SET `Boot` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:29] >> mysql_query( Connection handle: 1 )


    [20:25:29] CMySQLHandler::Query(UPDATE `player` SET `Fly` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:29] >> mysql_query( Connection handle: 1 )


    [20:25:29] CMySQLHandler::Query(UPDATE `player` SET `Heli` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:29] >> mysql_query( Connection handle: 1 )


    [20:25:29] CMySQLHandler::Query(UPDATE `player` SET `Skin` = 26 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:29] >> mysql_query( Connection handle: 1 )


    [20:25:29] CMySQLHandler::Query(UPDATE `player` SET `Leader` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:29] >> mysql_query( Connection handle: 1 )


    [20:25:29] CMySQLHandler::Query(UPDATE `player` SET `Member` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:29] >> mysql_query( Connection handle: 1 )


    [20:25:29] CMySQLHandler::Query(UPDATE `player` SET `Rank` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:29] >> mysql_query( Connection handle: 1 )


    [20:25:30] CMySQLHandler::Query(UPDATE `player` SET `Payday` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:30] >> mysql_query( Connection handle: 1 )


    [20:25:30] CMySQLHandler::Query(UPDATE `player` SET `Monate` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:30] >> mysql_query( Connection handle: 1 )


    [20:25:30] CMySQLHandler::Query(UPDATE `player` SET `Ticket` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:30] >> mysql_query( Connection handle: 1 )


    [20:25:31] CMySQLHandler::Query(UPDATE `player` SET `Nummer` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:31] >> mysql_query( Connection handle: 1 )


    [20:25:31] CMySQLHandler::Query(UPDATE `player` SET `Vertrag` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:31] >> mysql_query( Connection handle: 1 )


    [20:25:31] CMySQLHandler::Query(UPDATE `player` SET `Wanted` = 0 WHERE `ID` = 3 LIMIT 1;) - Successfully executed.


    [20:25:40] >> mysql_close( Connection handle: 1 )


    [20:25:40] CMySQLHandler::~CMySQLHandler() - deconstructor called.


    [20:25:40] CMySQLHandler::FreeResult() - The result is already empty.


    [20:25:40] CMySQLHandler::Disconnect() - Connection was closed.

    Einmal editiert, zuletzt von Angelo_Merte ()