Wei Posted March 3, 2013 Share 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 ? Link to comment
gokalpfirat Posted March 3, 2013 Share Posted March 3, 2013 Why you get 5th result from table? Maybe because of this. Link to comment
Jaysds1 Posted March 3, 2013 Share 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 Link to comment
Wei Posted March 3, 2013 Author Share Posted March 3, 2013 ERROR: Troll-Login\server.lua:17: attempt to concatenate local 'v' (a table value) Link to comment
Wei Posted March 3, 2013 Author Share Posted March 3, 2013 ERROR: Troll-Login\server.lua:17: attempt to concatenate local 'v' (a table value) Link to comment
Jaysds1 Posted March 3, 2013 Share 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 Link to comment
Wei Posted March 3, 2013 Author Share Posted March 3, 2013 ERROR: Troll-Login\server.lua:17: attempt to concatenate field '?' (a nil value) Link to comment
Jaysds1 Posted March 3, 2013 Share Posted March 3, 2013 copy the code again from above, I've edited it Link to comment
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