Jump to content

Sqlite dbPoll


Hero192

Recommended Posts

Can anyone explain why we should use this type? and why we should do return

function checking(ACC) 
    local query = dbQuery(connection, "SELECT * FROM data WHERE name = '" ..tostring(ACC) .. "'") 
    local result = dbPoll(query,-1) 
    if ( type( result ) == "table" and #result > 0 ) or not result then 
        return true --Why this?  
    else 
        return false -- WHy this? to return what 
    end 
end 

Link to comment

This is a simple MySQL query that checks if something is in the table. If it found what you were looking for it is going to return true ( so you can execute your code ) but if it didn't find anything it will return false ( your code is not going to execute ).

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...