Hero192 Posted September 29, 2015 Share Posted September 29, 2015 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
t3wz Posted September 29, 2015 Share Posted September 29, 2015 You don't need to return anything, dbPoll is used to get the result of a dbQuery. [...] Use the returned query handle with dbPoll to get the result, or dbFree if you don't want the result obs: if you're calling checking() in another function then the return is necessary Link to comment
pa3ck Posted October 3, 2015 Share Posted October 3, 2015 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
Hero192 Posted October 3, 2015 Author Share Posted October 3, 2015 Thanks for your efforts, everything handled already by TAPL via pm and in forums ! 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