How can i do this? I'm using andyvincent's mysql module, and i know it returns a table, but when i do anything other than tostring(table[1]) it says nill. I know theres stuff there, because PrintTable returns stuff. The database structure is:
Name
Steamid
Class
I wana get class, and check if it is "banned" and if so, kick the player. But how would i do this? I have a whole long auth code, but my query function is:
[lua]
function query(str, ply)
Msg("Begining of query func\n")
local table, success, error = mysql.query(db, str)
if (not success) then Msg(tostring(error)) end
if table[1] then Msg("Congratulations "..ply:Nick().."! You are in the database!\n") end
//if table[3] == "banned" then ply:Kick("Your banned.")
if !table[1] then Msg("Sorry "..ply:Nick()..", you are not in the database.\n") AddPlayer(ply) end
end
[/lua]
So how would i get any of the values in the columns in the table?
Sorry, you need to Log In to post a reply to this thread.