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


    Ich habe ein Problem mit MySQL, nähmlich folgendes:
    Ich bekommen folgende Errors:

    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\Selfmade.pwn(510) : error 017: undefined symbol "mysql_query"
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\Selfmade.pwn(523) : error 017: undefined symbol "mysql_query"
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\Selfmade.pwn(531) : error 017: undefined symbol "mysql_query"
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\Selfmade.pwn(559) : error 017: undefined symbol "mysql_query"
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\Selfmade.pwn(561) : error 017: undefined symbol "mysql_fetch_int"
    C:\Users\Narushi\Desktop\samp\New-Evolution-Reallife\gamemodes\Selfmade.pwn(587) : error 017: undefined symbol "mysql_query"
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    6 Errors.


    Eigentlich solltest diese Errors ja nicht erscheinen, denn die a_mysql.inc (neueste) besitze ich bereits!


    .:: a_mysql.inc ::.

  • Mein Ordner beinhaltet:


    - filterscript (Ordner)
    - gamemodes (Ordner)
    - include (Ordner)
    - npcmodes (Ordner)
    - pawno (Ordner)
    - plugins (Ordner)
    - scriptfiles (Ordner)

    - announce.exe
    - crashinfo.txt
    - libmysql.dll
    - samp.exe
    - samp_debug.exe
    - samp-license.txt
    - samp-npc.exe
    - samp-server.exe
    - savedposition.exe
    - server.cfg
    - server_log.txt
    - server-readme.txt


  • zeig mal deine stocks.
    Vielleicht liegt es daran.

  • Also, hier sind meine mysql und Save-/Loadstock's



    stock Connect_To_Database()
    {
    mysql_connect(SQL_HOST, SQL_USER, SQL_DATA, SQL_PASS);
    if(mysql_ping() == 1)
    {
    print("<-| [MYSQL] Verbindung zur Datenbank wurde erfolgreich hergestellt!");
    return true;
    }
    else
    {
    print("<-| [MYSQL] Es konnte keine Verbindung zur Datenbank hergestellt werden!");
    print("<-| [MYSQL] Es wird erneut versucht eine Verbindung zur Datenbank herzustellen!");
    mysql_connect(SQL_HOST, SQL_USER, SQL_DATA, SQL_PASS);
    if(mysql_ping() == 1)
    {
    print("<-| [MYSQL] Es konnte im 2 Versuch eine Verbindung hergestellt werden!");
    return true;
    }
    else
    {
    print("<-| [MYSQL] Es konnte keine Verbindung zur Datenbank hergestellt werden!");
    print("<-| [MYSQL] Der Server wird nun beendet!");
    SendRconCommand("exit");
    return true;
    }
    }
    }
    stock mysql_CheckAccount(playerid)
    {
    new Query[128],Name[MAX_PLAYER_NAME],count;
    GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
    mysql_real_escape_string(Name, Name);
    format(Query, sizeof(Query), "SELECT * FROM `accounts` WHERE `Name` = '%s'", Name);
    mysql_query(Query);
    mysql_store_result();
    count = mysql_num_rows();
    mysql_free_result();
    return count;
    }
    stock CreateAccount(playerid, pass[])
    {
    new query[256],Name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
    mysql_real_escape_string(Name,Name);
    mysql_real_escape_string(pass,pass);
    format(query, sizeof(query), "INSERT INTO `accounts` (`Name`, `Passwort`) VALUES ('%s', '%s')", Name, pass);
    mysql_query(query);
    return true;
    }
    stock mysql_ReturnPasswort(Name[])
    {
    new query[130], Get[130];
    mysql_real_escape_string(Name, Name);
    format(query, 128, "SELECT `passwort` FROM `accounts` WHERE `Name` = '%s'", Name);
    mysql_query(query);
    mysql_store_result();
    mysql_fetch_row(Get);
    mysql_free_result();
    return Get;
    }
    stock mysql_GetString(Table[], Field[], Where[], Is[])
    {
    new query[128], Get[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();
    mysql_fetch_row(Get);
    mysql_free_result();
    return Get;
    }
    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;
    }
    stock Float:mysql_GetFloat(Table[], Field[], Where[], Is[])
    {
    new query[128], Float:sqlfloat;
    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();
    mysql_fetch_float(sqlfloat);
    mysql_free_result();
    return sqlfloat;
    }
    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;
    }
    stock SavePlayer(playerid)
    {
    if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
    {
    if(GetPVarInt(playerid,"Eingeloggt") == 1)
    {
    GetPlayerName(playerid, PlayerInfo[playerid][pName], MAX_PLAYER_NAME);
    mysql_SetInt("accounts","Level",GetPlayerScore(playerid),"Name",PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts","Geld",GetPlayerMoney(playerid),"Name",PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts","Adminlevel",PlayerInfo[playerid][pAdmin],"Name",PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts","Supporter",PlayerInfo[playerid][pSup],"Name",PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts","Member",PlayerInfo[playerid][pMember],"Name",PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts","Leader",PlayerInfo[playerid][pLeader],"Name",PlayerInfo[playerid][pName]);
    mysql_SetInt("accounts","Skin",PlayerInfo[playerid][pSkin],"Name",PlayerInfo[playerid][pName]);
    print("Spieler erfolgreich gespeichert!");
    }
    }
    }
    stock LoadPlayer(playerid)
    {
    if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
    {
    if(GetPVarInt(playerid,"Eingeloggt") == 1)
    {
    GetPlayerName(playerid, PlayerInfo[playerid][pName], MAX_PLAYER_NAME);
    GivePlayerMoney(playerid,mysql_GetInt("accounts", "Geld", "Name", PlayerInfo[playerid][pName]));
    SetPlayerScore(playerid, mysql_GetInt("accounts", "Level", "Name", PlayerInfo[playerid][pName]));
    PlayerInfo[playerid][pAdmin] = mysql_GetInt("accounts", "AdminLevel", "Name", PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pSup] = mysql_GetInt("accounts","Supporter","Name",PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pMember] = mysql_GetInt("accounts","Member","Name",PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pLeader] = mysql_GetInt("accounts","Leader","Name",PlayerInfo[playerid][pName]);
    PlayerInfo[playerid][pSkin] = mysql_GetInt("accounts", "Skin", "Name", PlayerInfo[playerid][pName]);
    print("Spieler erfolgreich geladen!");
    }
    }
    return 1;
    }

  • Hast du schon in deinen Ordner die libmySQL.dll getan. Wie ich es gemacht habe. Wenns immer nocht nicht geht dann schau dir das Tutorial an:


    Was hat die Libmysql mit der Include zu tun?
    In der Linie Nix um die errors wegzubekommen, sollte er nicht die R7 nehmen sondern
    die R6 Plugin + Includes dann sollte es auch gehen

    All in all it's just another brick in the wall

  • Schreib mal oben:


    #include


    #define SQL_HOST "127.0.0.1" //localhost
    #define SQL_USER "root"
    #define SQL_PASS "" //ist passwort
    #define SQL_DATA "cdcol" //hier der Name</a_mysql>


    also habe jetzt

    #define SQL_HOST "127.0.0.1" //localhost
    #define SQL_USER "root" //Habe ich so gelassen
    #define SQL_PASS "" //Leer gelassen
    #define SQL_DATA "accounts" //Name meiner MySQL Tabelle? ^^


    Hoffe es ist richtig :x habe aber trotzdem diese 6 Errors

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen