Save Account

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
  • Guten Tag,


    Und zwar speichert er mir nicht die Daten ab.


    Code:


    Spoiler anzeigen
    stock SaveAccount(extraid)
    {
    new mainQuery[2046], secondQuery[512];
    format(secondQuery, sizeof(secondQuery), "UPDATE `"#SERVERTAG"_Accounts` SET `Eingeloggt` = '%i', `Admin` = '%i', `Geschlecht` = '%i' WHERE `Name` = '%d'",
    pInfo[extraid][pEingeloggt],pInfo[extraid][pAdmin],pInfo[extraid][pGeschlecht],pInfo[extraid][pName]);
    strcat(mainQuery, secondQuery);
    mysql_function_query(mycon, mainQuery, false, "", "");
    return 1;
    }



    MySQL_LOG:


    SQL
    [18:54:20] [DEBUG] mysql_connect - host: "127.0.0.1", user: "root", database: "samp:selfmade", password: "****", port: 3306, autoreconnect: true, pool_size: 2[18:54:20] [DEBUG] CMySQLHandle::Create - creating new connection..[18:54:20] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called[18:54:20] [DEBUG] CMySQLHandle::Create - connection created (id: 1)[18:54:20] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[18:54:20] [DEBUG] CMySQLConnection::Connect - connection was successful[18:54:20] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[18:54:20] [DEBUG] mysql_errno - connection: 1[18:54:20] [DEBUG] mysql_tquery - connection: 1, query: "CREATE TABLE IF NOT EXISTS `GBC_Accounts` (  `ID` int(5) NOT NUL", callback: "(null)", format: "(null)"[18:54:20] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[18:54:20] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[18:54:20] [DEBUG] CMySQLConnection::Connect - establishing connection to database...[18:54:20] [DEBUG] CMySQLConnection::Connect - connection was successful[18:54:20] [DEBUG] CMySQLConnection::Connect - connection was successful[18:54:20] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[18:54:20] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[18:54:20] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled[18:54:20] [DEBUG] CMySQLQuery::Execute[] - starting query execution[18:54:20] [DEBUG] CMySQLQuery::Execute[] - query was successfully executed within 378.751 milliseconds[18:54:20] [DEBUG] CMySQLQuery::Execute[] - no callback specified, skipping result saving[18:55:04] [DEBUG] mysql_format - connection: 1, len: 66, format: "SELECT * FROM `GBC_Accounts` WHERE `Name` = '%s'"[18:55:04] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `GBC_Accounts` WHERE `Name` = 'IntelCore'", callback: "OnQueryFinish", format: "siii"[18:55:04] [DEBUG] CMySQLQuery::Execute[OnQueryFinish] - starting query execution[18:55:04] [DEBUG] CMySQLQuery::Execute[OnQueryFinish] - query was successfully executed within 1.443 milliseconds[18:55:04] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[18:55:04] [DEBUG] Calling callback "OnQueryFinish"..[18:55:04] [DEBUG] cache_get_data - connection: 1[18:55:04] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called[18:55:06] [DEBUG] mysql_format - connection: 1, len: 100, format: "INSERT INTO `GBC_Accounts` (`Name`,`Passwort`) VALUES ('%s', md5('%s'))"[18:55:06] [DEBUG] mysql_query - connection: 1, query: "INSERT INTO `GBC_Accounts` (`Name`,`Passwort`) VALUES ('IntelCor", use_cache: true[18:55:06] [DEBUG] CMySQLQuery::Execute - starting query execution[18:55:06] [DEBUG] CMySQLQuery::Execute - query was successfully executed within 53.244 milliseconds[18:55:06] [DEBUG] CMySQLResult::CMySQLResult() - constructor called[18:55:06] [DEBUG] CMySQLHandle::SaveActiveResult - cache saved (id: 1)[18:55:10] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `GBC_Accounts` SET `Eingeloggt` = '0', `Admin` = '0', `Ge", callback: "(null)", format: "(null)"[18:55:10] [DEBUG] CMySQLQuery::Execute[] - starting query execution[18:55:10] [DEBUG] CMySQLQuery::Execute[] - query was successfully executed within 0.505 milliseconds[18:55:10] [DEBUG] CMySQLQuery::Execute[] - no callback specified, skipping result saving



    Was ist daran falsch ?
    Jeffry:

  • Der Name ist ein String, daher %s.
    Außerdem kannst du einen kleineren Query String verwenden:
    stock SaveAccount(extraid)
    {
    new query[256],;
    format(query, sizeof(query), "UPDATE `"#SERVERTAG"_Accounts` SET `Eingeloggt` = '%i', `Admin` = '%i', `Geschlecht` = '%i' WHERE `Name` = '%s'",
    pInfo[extraid][pEingeloggt],pInfo[extraid][pAdmin],pInfo[extraid][pGeschlecht],pInfo[extraid][pName]);
    mysql_function_query(mycon, query, false, "", "");
    return 1;
    }