Wei Posted March 3, 2013 Posted March 3, 2013 local checkSave = dbQuery( test_db, "SELECT * FROM accounts WHERE serial=?", getPlayerSerial(source) ) local result = dbPoll( checkSave, -1 ) outputChatBox(result[5]) Why does this return nil ?
gokalpfirat Posted March 3, 2013 Posted March 3, 2013 Why you get 5th result from table? Maybe because of this.
Jaysds1 Posted March 3, 2013 Posted March 3, 2013 try this: local checkSave = dbQuery( test_db, "SELECT * FROM accounts WHERE serial=?", getPlayerSerial(source) ) local result = dbPoll( checkSave, -1 ) for i,v in pairs(result)do outputChatBox(i..":"..v) end
Wei Posted March 3, 2013 Author Posted March 3, 2013 ERROR: Troll-Login\server.lua:17: attempt to concatenate local 'v' (a table value)
Wei Posted March 3, 2013 Author Posted March 3, 2013 ERROR: Troll-Login\server.lua:17: attempt to concatenate local 'v' (a table value)
Jaysds1 Posted March 3, 2013 Posted March 3, 2013 (edited) ok, try this: local checkSave = dbQuery( test_db, "SELECT * FROM accounts WHERE serial=?", getPlayerSerial(source) ) local result = dbPoll( checkSave, -1 ) for i,v in pairs(result)do for _,b in ipairs(v)do outputChatBox(i..":"..b) end end Edited March 3, 2013 by Guest
Wei Posted March 3, 2013 Author Posted March 3, 2013 ERROR: Troll-Login\server.lua:17: attempt to concatenate field '?' (a nil value)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now