danieljuniorce Posted June 26, 2019 Share Posted June 26, 2019 (edited) Bom, estou usando o banco de dados Mysql com DbConnect() e etc... Só que ao executa uma query, e esperando o valores requisitado retornarem, só que volta somente o valores true, false or nil... e não os valores que solicitei. Ex: username, password, money e etc... local Connect = nil function connect(resource) Connect = dbConnect( "mysql", "dbname=ssl;host=127.0.0.1;port=3306;charset=utf8", "root", "" ) if (not Connect) then outputDebugString(getResourceName(resource) .. ": Failed to establish connection to the MySQL database server") return true else outputDebugString(getResourceName(resource) .. ": Connected to the MySQL database server") return false end end addEventHandler("onResourceStart",resourceRoot, connect) function Query( ... ) if Connect then local query = dbQuery(Connect, ... ) local result = dbPoll(query, -1) return result else return false end end function QuerySingle(str, ...) if Connect then local result = Query(str, ...) if type(result) == 'table' then return result end else return false end end function QueryExecute(str, ...) if Connect then local query = dbExec(Connect, str, ...) return query else return false end end Edited June 26, 2019 by DeanSouza Link to comment
DNL291 Posted June 26, 2019 Share Posted June 26, 2019 Se o banco de dados tiver funcionando corretamente mostre aqui o trecho do código que você fez a consulta, caso contrário o problema está em dbConnect. @DeanSouza 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