• Quick TMysql2 problem
    2 replies, posted
[b] RESOLVED, see below [/b] So, I have a successful connection which I can see in my MySQL Administrator tool. Now, I run this: [lua] function iA.cb(res, stat, err) print(err .. "|" .. stat) --if err then print("TMYSQL ERROR iA.cb : " .. stat) end end tmysql.query("CREATE TABLE IF NOT EXISTS admins (id int(6) NOT NULL AUTO_INCREMENT, steamid varchar(25), PRIMARY KEY (id))", iA.cb) [/lua] It never prints anything (indicating it never got to the callback), and it never created the table. The same thing happens with any other queries I do, they never seem to get to the callback. No lua errors.
It won't work on an empty dedicated server, one solution is to add a bot and kick it to wake the server up.
Oh. So I can't run any queries until there is a player or bot in the server... D: [editline]04:54PM[/editline] Fixed, [lua] hook.Add("PlayerInitialSpawn", "iAPInitSpawn", function() tmysql.query("CREATE TABLE IF NOT EXISTS admins (id int(6) AUTO_INCREMENT, steamid varchar(25), PRIMARY KEY (id))", iA.cb) tmysql.query("SELECT steamid FROM admins WHERE steamid='STEAM_0:0:7623695'", iA.cbInfCheck) end) [/lua]
Sorry, you need to Log In to post a reply to this thread.