// 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
Original issue reported on code.google.com by
yahan.clark
on 28 Jul 2010 at 8:34