Karoffe Posted June 25, 2014 Share Posted June 25, 2014 Well, i am working on a script actually just to learn more SQLITE, i used to use sqlite in the past but seems that now i forgot everything i learnt.. function onPlayerCommand() local result = dbPoll(dbQuery( connection, "SELECT PlayerName FROM Test WHERE PlayerName=?;", 'test'), -1) for i=1, #result do outputChatBox(tostring(result[i].log)) end end addCommandHandler ("result", onPlayerCommand) It outputs "Nil" instead of "Test".. I made a Sqlite Table which has 29 result in a table called PlayerName all the results should be "Test" but it outputs "nil" instead.. No Debug Errors. Link to comment
Karoffe Posted June 25, 2014 Author Share Posted June 25, 2014 Ops, Posted in the wrong board please anystaff move it to the right board Link to comment
Castillo Posted June 25, 2014 Share Posted June 25, 2014 That's because you are trying to obtain the "log" column data, but you are only selecting "PlayerName" in your query. Link to comment
Karoffe Posted June 28, 2014 Author Share Posted June 28, 2014 Sorry for late response. That's because you are trying to obtain the "log" column data, but you are only selecting "PlayerName" in your query. so i should remove ".log" in the outputchatbox right ?.. tried to do that but now instead of outputting "nil" it outputs table: 04B0AB58 table: 04B0ABD0 table: 04B0AC48 table: 04B0AC98 ... and many more Link to comment
xXMADEXx Posted June 28, 2014 Share Posted June 28, 2014 You can keep ".log" but change your query string to this: SELECT * FROM Test WHERE PlayerName=?; 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