BusDunk Posted July 7, 2014 Share Posted July 7, 2014 Hello, my problem is that I cannot get back a data from my database. When I try to do it with a dbExec and tostring, it only answers "true" local test = tostring(dbExec(handler,"SELECT favorite_color FROM players")) outputChatBox("Your favorite color is : "..test.." ", source, 125,0,0) ChatBox shows : Your favorite color is : true I would like the ChatBox to display (for example) : Your favorite color is : red Link to comment
DiSaMe Posted July 7, 2014 Share Posted July 7, 2014 dbExec is a function that doesn't deal with results in any way. If you need to get a result from the database, use these functions: dbQuery -- to execute the query dbPoll -- to get results from the query Link to comment
BusDunk Posted July 8, 2014 Author Share Posted July 8, 2014 Thank you. I solved my problem thanks to your help. I'm still a script beginner and it's been the second time you helped me. I thank you a lot. 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