MySQL Fehler?

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 Abend,


    ich sitze grade an einem User w User System dran. Und die Mysql log zeigt mir folgende Errors:


    SQL
    [23:01:00]  [23:01:00] ---------------------------[23:01:00] MySQL Debugging activated (04/16/13)[23:01:00] ---------------------------[23:01:00]  [23:01:00] >> mysql_connect( )[23:01:00] CMySQLHandler::CMySQLHandler() - constructor called.[23:01:00] CMySQLHandler::CMySQLHandler() - Connecting to "-----" | DB: "------" | Username: "----" ...[23:01:01] CMySQLHandler::Connect() - Connection was successful.[23:01:01] CMySQLHandler::Connect() - Auto-Reconnect has been enabled.[23:01:01] >> mysql_ping( Connection handle: 1 )[23:01:01] CMySQLHandler::Ping() - Connection is still alive.[23:01:24] >> mysql_real_escape_string( Connection handle: 1 )[23:01:24] CMySQLHandler::EscapeString(Andrzejxys); - Escaped 10 characters to Andrzejxys.[23:01:24] >> mysql_query( Connection handle: 1 )[23:01:24] CMySQLHandler::Query(SELECT * FROM accounts WHERE Name = 'Andrzejxys') - Successfully executed.[23:01:24] >> mysql_store_result( Connection handle: 1 )[23:01:24] CMySQLHandler::StoreResult() - Result was stored.[23:01:24] >> mysql_num_rows( Connection handle: 1 )[23:01:24] CMySQLHandler::NumRows() - Returned 0 row(s)[23:01:24] >> mysql_real_escape_string( Connection handle: 1 )[23:01:24] CMySQLHandler::EscapeString(Andrzejxys); - Escaped 10 characters to Andrzejxys.[23:01:24] >> mysql_real_escape_string( Connection handle: 1 )[23:01:24] CMySQLHandler::EscapeString(a); - Escaped 1 characters to a.[23:01:24] >> mysql_query( Connection handle: 1 )[23:01:24] CMySQLHandler::Query(INSERT INTO accounts (Name, Passwort) VALUES ('Andrzejxys', 'a')) - Successfully executed.[23:01:28] >> mysql_query( Connection handle: 1 )[23:01:28] CMySQLHandler::Query(SELECT Name FROM accounts WHERE Name = 'Andrzejxy') - Successfully executed.[23:01:28] >> mysql_num_rows( Connection handle: 1 )[23:01:28] CMySQLHandler::NumRows() - Returned 0 row(s)[23:01:31] >> mysql_query( Connection handle: 1 )[23:01:31] CMySQLHandler::Query(SELECT Name FROM accounts WHERE Name = 'y') - An error has occured. (Error ID: 2014, Commands out of sync; you can't run this command now)[23:01:31] >> mysql_num_rows( Connection handle: 1 )[23:01:31] CMySQLHandler::NumRows() - Returned 0 row(s)[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(Level); - Escaped 5 characters to Level.[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(); - Escaped 0 characters to .[23:01:34] >> mysql_query( Connection handle: 1 )[23:01:34] CMySQLHandler::Query(UPDATE accounts SET Level = '0' WHERE Name = '') - An error has occured. (Error ID: 2014, Commands out of sync; you can't run this command now)[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(Geld); - Escaped 4 characters to Geld.[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(); - Escaped 0 characters to .[23:01:34] >> mysql_query( Connection handle: 1 )[23:01:34] CMySQLHandler::Query(UPDATE accounts SET Geld = '0' WHERE Name = '') - An error has occured. (Error ID: 2014, Commands out of sync; you can't run this command now)[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(Kills); - Escaped 5 characters to Kills.[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(); - Escaped 0 characters to .[23:01:34] >> mysql_query( Connection handle: 1 )[23:01:34] CMySQLHandler::Query(UPDATE accounts SET Kills = '0' WHERE Name = '') - An error has occured. (Error ID: 2014, Commands out of sync; you can't run this command now)[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(Tode); - Escaped 4 characters to Tode.[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(); - Escaped 0 characters to .[23:01:34] >> mysql_query( Connection handle: 1 )[23:01:34] CMySQLHandler::Query(UPDATE accounts SET Tode = '0' WHERE Name = '') - An error has occured. (Error ID: 2014, Commands out of sync; you can't run this command now)[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(Team); - Escaped 4 characters to Team.[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(); - Escaped 0 characters to .[23:01:34] >> mysql_query( Connection handle: 1 )[23:01:34] CMySQLHandler::Query(UPDATE accounts SET Team = '0' WHERE Name = '') - An error has occured. (Error ID: 2014, Commands out of sync; you can't run this command now)[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(accounts); - Escaped 8 characters to accounts.[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(Rang); - Escaped 4 characters to Rang.[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(Name); - Escaped 4 characters to Name.[23:01:34] >> mysql_real_escape_string( Connection handle: 1 )[23:01:34] CMySQLHandler::EscapeString(); - Escaped 0 characters to .[23:01:34] >> mysql_query( Connection handle: 1 )[23:01:34] CMySQLHandler::Query(UPDATE accounts SET Rang = '0' WHERE Name = '') - An error has occured. (Error ID: 2014, Commands out of sync; you can't run this command now)


    Code:


    case DIALOG_UWU:
    {
    if(response)
    {
    new query[128];
    format(query, sizeof(query), "SELECT Name FROM accounts WHERE Name = '%s'", inputtext);
    mysql_query(query);
    if(mysql_num_rows() != 0)
    {
    SendClientMessage(playerid, 0xFFFFFFFF ,"Spieler wurde gefunden!");
    if(IsPlayerConnected(GetPlayerID(inputtext)) == 1)
    {
    new level = mysql_GetInt("accounts", "Level", "Name", inputtext)+2,
    string[128];
    GivePlayerMoney(GetPlayerID(inputtext), 2000);
    format(query,sizeof(query), "UPDATE accounts SET Level='%s' WHERE Name = '%s'",level,inputtext);
    mysql_query(query);
    format(string,sizeof(string), "Spieler %s hat dich als Werber angegeben. Dir wurden 2.000 $ und 2 Level gutgeschrieben.");
    SendClientMessage(GetPlayerID(inputtext), 0xFFFFFFFF, string);
    }
    }
    else
    {
    SendClientMessage(playerid, 0xFFFFFFFF, "Dieser Spieler wurde nicht gefunden!");
    ShowPlayerDialog(playerid, DIALOG_UWU ,DIALOG_STYLE_INPUT, "User werben User", "Wurdest du von einem User auf unseren Server geholt?\nGib seinen Namen hier an, damit er einen kleinen Bonus bekommt.\nSolltest du nicht geworben sein, klicke auf 'Niemand'.", "Weiter","Niemand");
    }
    }
    else
    {
    SendClientMessage(playerid, 0xFFFFFFFF ,"Du wurdest von niemandem geworben.");
    }
    }

  • schau dir den mysql_GetInt-stock mal an:


    stock mysql_GetInt(Table[], Field[], Where[], Is[])
    {
    new query[128];
    mysql_real_escape_string(Table, Table);
    mysql_real_escape_string(Field, Field);
    mysql_real_escape_string(Where, Where);
    mysql_real_escape_string(Is, Is);
    format(query, 128, "SELECT `%s` FROM `%s` WHERE `%s` = '%s'", Field, Table, Where, Is);
    mysql_query(query);
    mysql_store_result();
    new sqlint = mysql_fetch_int();
    mysql_free_result();
    return sqlint;
    }


    Hier ein Beispiel aus meinem Script:
    mysql_GetInt("accounts", "NextPayday", "Name", SpielerInfo[playerid][pName]);


    Vergleich das mal mit new level = ...


    lg 8)

  • mein mysql getint sieht so aus;


    stock mysql_GetInt(Table[], Field[], Where[], Is[])
    {
    new query[128];
    mysql_real_escape_string(Table, Table);
    mysql_real_escape_string(Field, Field);
    mysql_real_escape_string(Where, Where);
    mysql_real_escape_string(Is, Is);
    format(query, 128, "SELECT %s FROM %s WHERE %s = '%s'", Field, Table, Where, Is);
    mysql_query(query);
    mysql_store_result();
    new sqlint = mysql_fetch_int();
    mysql_free_result();
    return sqlint;
    }


    hab das alles von maddins tutorial


  • new level = mysql_GetInt("accounts", "Level", "Name", SpielerInfo[][]) //Ich glaube er meinte du sollst das Enum hier eintragen, und wieso Inputtext+2?


    Engelsflügel am Astonkühler, als Schutz vor dem Teufel!