Extinction Posted March 26, 2017 Share Posted March 26, 2017 (edited) 1. What does dbPoll exactly do? 2. What does dbFree exactly do? 3. How would I put data from sql into a client side script, what functions would i need? And are there any explained examples? Edited March 26, 2017 by Extinction Link to comment
Gordon_G Posted March 26, 2017 Share Posted March 26, 2017 1 . dbPoll is used to keep a result from a dbExec 2 . dbFree is used when you don't need to keep a result from a dbExec 3 . You'll need to triggerServerEvent. Link to comment
Extinction Posted March 26, 2017 Author Share Posted March 26, 2017 What's the difference between dbExec and dbQuery, looks like they both do the same job to me? Link to comment
NeXuS™ Posted March 26, 2017 Share Posted March 26, 2017 dbQuery is for getting data, dbExec for inserting. Link to comment
Extinction Posted March 26, 2017 Author Share Posted March 26, 2017 Oh, I see. So what would be an example of dbFree and dbPoll, is there any explained example you guys can share? Link to comment
NeXuS™ Posted March 26, 2017 Share Posted March 26, 2017 local sqlConnect = dbConnect("sqlite", "test.db") local querryH = dbQuerry(sqlConnect, "SELECT * FROM accounts") if querryH == statementHere then neededData = dbPoll(querryH, -1) else dbFree(querryH) end Thats all. Link to comment
Extinction Posted March 26, 2017 Author Share Posted March 26, 2017 (edited) So if I did something like this, would it work - function checkAccounts(username) local sqlConnect = dbConnect("sqlite", "test.db") local querryH = dbQuery(sqlConnect, "SELECT * FROM accounts WHERE username = ?", username) if querryH == "Extinction" then neededData = dbPoll(querryH, -1) outputChatBox("Username was found, listing all current usernames: ", source) outputChatBox(querryH) --- To list all the usernames in DB? else outputChatBox("Username was not found", source) dbFree(querryH) end checkAccounts() Edited March 26, 2017 by Extinction Link to comment
NeXuS™ Posted March 26, 2017 Share Posted March 26, 2017 You should read the dbPoll and dbFree desc. 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