azuisleet / gmodmodules

Automatically exported from code.google.com/p/gmodmodules
19 stars 4 forks source link

tmysql2 Query Problem #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
// Connect and Require
require("tmysql")

function ConnectToMySQL ( )
    tmysql.initialize("localhost", "root", "", "perp", 3306, 6, 5)
    print("MySQL initializing!")
    RunConsoleCommand("say", "MySQL initializing!")
end

ConnectToMySQL();

// Query
function ASS_LoadRankings()
    ASS_RunPluginFunction("LoadRankings")
    /*for k, v in pairs(player.GetAll()) do
        if !v:IsValid() and !v:IsPlayer then return end
        tmysql.query("SELECT `id`, `name`, `rank` FROM `users` WHERE `id`='" .. v:SteamID() .. "'",
        function ( MySQLRes )
            if !MySQLRes then DebugMessage('No MySQL results. Abandoning load proccess.'); return false; end
            local Rank = tonumber(MySQLRes[1][3]) or 10;
            v:SetLevel(Rank)
        end
        , true);
    end*/
end
// The Error
003:33:56 Lua Error: Hook 'TMysqlPoll' Failed: Unable to create table for query 
callback.

Original issue reported on code.google.com by yahan.clark on 28 Jul 2010 at 8:34

GoogleCodeExporter commented 9 years ago
Using old version of tmysql2, try updating to latest.

Original comment by AzuiSl...@gmail.com on 18 Aug 2010 at 6:08

GoogleCodeExporter commented 9 years ago

Original comment by AzuiSl...@gmail.com on 18 Aug 2010 at 6:08