In Tabelle wird nichts eingetragen!

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 eine Tabelle erstellt in Navicat, jedoch wird nichts eingetragen wenn ich ein Haus erstelle!


    stock Hauserstellen(Float:hX, Float:hY, Float:hZ, hPreis,hInterior,hMieter)
    {
    new query[400],string[64];
    format(string,sizeof(string),"Haus%d",Houses+1);
    format(query, sizeof(query), "INSERT INTO `accounts` (`HausID`, `X-Pos`, `Y-Pos`, `Z-Pos`, `Preis`, `Interior`, `MaxMieter``Mieter``Besitzer`) VALUES ('%d', '%f','%f','%f','%d','%d','%d','%d','%s')", Houses+1, hX,hY,hZ,hPreis,hInterior,hMieter,0,"keiner");
    mysql_query(query);
    switch (hInterior)
    {
    case 1:{mysql_SetIntHaus("houses", "InteriorID", 1, "HausID", string);mysql_SetFloatHaus("houses", "InteriorFloat:x", 271.884979, "HausID", string);mysql_SetFloatHaus("houses", "InteriorFloat:y", 306.631988, "HausID", string);mysql_SetFloatHaus("houses", "InteriorFloat:z", 999.148437, "HausID", string);}//Katie Room
    case 2:{mysql_SetIntHaus("houses", "InteriorID", 2, "HausID", string);mysql_SetFloatHaus("houses", "InteriorFloat:x", 2454.717041, "HausID", string);mysql_SetFloatHaus("houses", "InteriorFloat:y", -1700.871582, "HausID", string);mysql_SetFloatHaus("houses", "InteriorFloat:z", 1013.515197, "HausID", string);}//Ryders house
    }
    CreatePickup(1273,1,hX,hY,hZ,0);
    new hdlabel[50];
    format(hdlabel,sizeof(hdlabel),"HausID: %d\nPreis: %d$",Houses+1,hPreis);
    Create3DTextLabel(hdlabel,ROT,hX,hY,hZ,25,0);
    Houses=Houses+1;
    return 1;
    }

  • format(query, sizeof(query), "INSERT INTO `accounts` (`HausID`, `X-Pos`, `Y-Pos`, `Z-Pos`, `Preis`, `Interior`, `MaxMieter``Mieter``Besitzer`) VALUES ('%d', '%f','%f','%f','%d','%d','%d','%d','%s')", Houses+1, hX,hY,hZ,hPreis,hInterior,hMieter,0,"keiner");


    zu


    format(query, sizeof(query), "INSERT INTO `accounts` (`HausID`, `X-Pos`, `Y-Pos`, `Z-Pos`, `Preis`, `Interior`, `MaxMieter`, `Mieter`, `Besitzer`) VALUES ('%d', '%f','%f','%f','%d','%d','%d','%d','%s')", Houses+1, hX,hY,hZ,hPreis,hInterior,hMieter,0,"keiner");


    mit freundlichem Gruß
    Timo S.

  • stocks für mysql_SetIntHaus, sowie mysql_SetFloatHaus und Serverlog posten bitte.


    Umgeschrieben auf ohne Haus!
    stock mysql_SetInt(Table[], Field[], To, Where[], Where2[])
    {
    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(Where2, Where2);
    format(query, 128, "UPDATE `%s` SET `%s` = '%d' WHERE `%s` = '%s'", Table, Field, To, Where, Where2);
    mysql_query(query);
    return true;
    }
    stock mysql_SetString(Table[], Field[], To[], Where[], Where2[])
    {
    new query[128];
    mysql_real_escape_string(Table, Table);
    mysql_real_escape_string(Field, Field);
    mysql_real_escape_string(To, To);
    mysql_real_escape_string(Where, Where);
    mysql_real_escape_string(Where2, Where2);
    format(query, 128, "UPDATE `%s` SET `%s` = '%s' WHERE `%s` = '%s'", Table, Field, To, Where, Where2);
    mysql_query(query);
    return true;
    }
    stock mysql_SetFloat(Table[], Field[], Float:To, Where[], Where2[])
    {
    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(Where2, Where2);
    format(query, 128, "UPDATE `%s` SET `%s` = '%f' WHERE `%s` = '%s'", Table, Field, To, Where, Where2);
    mysql_query(query);
    return true;
    }


    LOG:
    ] CMySQLHandler::StoreResult() - Result was stored.


    [17:06:48] >> mysql_fetch_int( Connection handle: 1 )


    [17:06:48] CMySQLHandler::FetchRow() - Return: 6


    [17:06:48] >> mysql_free_result( Connection handle: 1 )


    [17:06:48] CMySQLHandler::FreeResult() - Result was successfully free'd.


    [17:06:48] >> mysql_query( Connection handle: 1 )


    [17:06:48] CMySQLHandler::Query(INSERT INTO `accounts` (`HausID`, `X-Pos`, `Y-Pos`, `Z-Pos`, `Preis`, `Interior`, `MaxMieter``Mieter``Besitzer`) VALUES ('1', '-2009.700195','128.389480','27.539062','1','1','1','0','keiner')) - An error has occured. (Error ID: 1136, Column count doesn't match value count at row 1)


    [17:06:48] >> mysql_real_escape_string( Connection handle: 1 )


    [17:06:48] CMySQLHandler::EscapeString(houses); - Escaped 6 characters to houses.


    [17:06:48] >> mysql_real_escape_string( Connection handle: 1 )


    [17:06:48] CMySQLHandler::EscapeString(InteriorID); - Escaped 10 characters to InteriorID.


    [17:06:48] >> mysql_real_escape_string( Connection handle: 1 )


    [17:06:48] CMySQLHandler::EscapeString(HausID); - Escaped 6 characters to HausID.


    [17:06:48] >> mysql_real_escape_string( Connection handle: 1 )


    [17:06:48] CMySQLHandler::EscapeString(Haus1); - Escaped 5 characters to Haus1.


    [17:06:48] >> mysql_query( Connection handle: 1 )


    [17:06:48] CMySQLHandler::Query(UPDATE `houses` SET `InteriorID` = '1' WHERE `HausID` = 'Haus1') - Successfully executed.


    [17:06:48] >> mysql_real_escape_string( Connection handle: 1 )


    [17:06:48] CMySQLHandler::EscapeString(houses); - Escaped 6 characters to houses.


    [17:06:48] >> mysql_real_escape_string( Connection handle: 1 )


    [17:06:48] CMySQLHandler::EscapeString(InteriorFloat:x); - Escaped 15 characters to InteriorFloat:x.


    [17:06:48] >> mysql_real_escape_string( Connection handle: 1 )


    [17:06:48] CMySQLHandler::EscapeString(HausID); - Escaped 6 characters to HausID.


    [17:06:48] >> mysql_real_escape_string( Connection handle: 1 )


    [17:06:48] CMySQLHandler::EscapeString(Haus1); - Escaped 5 characters to Haus1.


    [17:06:48] >> mysql_query( Connection handle: 1 )


    [17:06:48] CMySQLHandler::Query(UPDATE `houses` SET `InteriorFloat:x` = '271.884979' WHERE `HausID` = 'Haus1') - Successfully executed.


    [17:06:48] >> mysql_real_escape_string( Connection handle: 1 )


    [17:06:48] CMySQLHandler::EscapeString(houses); - Escaped 6 characters to houses.


    [17:06:48] >> mysql_real_escape_string( Connection handle: 1 )


    [17:06:48] CMySQLHandler::EscapeString(InteriorFloat:y); - Escaped 15 characters to InteriorFloat:y.


    [17:06:48] >> mysql_real_escape_string( Connection handle: 1 )


    [17:06:48] CMySQLHandler::EscapeString(HausID); - Escaped 6 characters to HausID.


    [17:06:48] >> mysql_real_escape_string( Connection handle: 1 )


    [17:06:48] CMySQLHandler::EscapeString(Haus1); - Escaped 5 characters to Haus1.


    [17:06:48] >> mysql_query( Connection handle: 1 )


    [17:06:48] CMySQLHandler::Query(UPDATE `houses` SET `InteriorFloat:y` = '306.631988' WHERE `HausID` = 'Haus1') - Successfully executed.


    [17:06:48] >> mysql_real_escape_string( Connection handle: 1 )


    [17:06:48] CMySQLHandler::EscapeString(houses); - Escaped 6 characters to houses.


    [17:06:48] >> mysql_real_escape_string( Connection handle: 1 )


    [17:06:48] CMySQLHandler::EscapeString(InteriorFloat:z); - Escaped 15 characters to InteriorFloat:z.


    [17:06:48] >> mysql_real_escape_string( Connection handle: 1 )


    [17:06:48] CMySQLHandler::EscapeString(HausID); - Escaped 6 characters to HausID.


    [17:06:48] >> mysql_real_escape_string( Connection handle: 1 )


    [17:06:48] CMySQLHandler::EscapeString(Haus1); - Escaped 5 characters to Haus1.


    [17:06:48] >> mysql_query( Connection handle: 1 )


    [17:06:48] CMySQLHandler::Query(UPDATE `houses` SET `InteriorFloat:z` = '999.148437' WHERE `HausID` = 'Haus1') - Successfully executed.