Jump to content

Sqlite Results


Karoffe

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...