Ben_Sherman Posted October 12, 2013 Share Posted October 12, 2013 Hi there, I'm still kinda new to lua coding but so far I'm doing good I guess, I'm working on a mod handler which will be toggled by a GUI where you can select mods and then it start downloading the file. I got some issues when loading the data from the database. I've printed every single thing but in the database the value is 0 on all of the mod lines which it doesn't print. Everytime I print it the value just increases starting from 1 and I press again it increases to 2, so it's kinda like it's printing each time I'm pressing the button... Any suggestions here? addEventHandler("LoadSettings", getRootElement(), function (thePlayer) local to = client local toID = getElementData( to, "account:id" ) local query1 = mysql:query("SELECT id FROM modsettings WHERE username='"..toID.."'") if (mysql:num_rows(query1) == 0) then local setsettings = mysql:query("INSERT INTO modsettings (`username`) VALUES ('"..toID.."')") else local query = mysql:query("SELECT mod1 FROM modsettings WHERE username='"..toID.."'") local field = "" ..query.. "" mysql:free_result(query) outputDebugString("Mod Package 1 "..field) ----- HERE------ local query = mysql:query("SELECT mod2 FROM modsettings WHERE username='"..toID.."'") local field = "" ..query.. "" mysql:free_result(query) outputDebugString("Mod Package 2 "..field) ----- HERE------ local query = mysql:query("SELECT mod3 FROM modsettings WHERE username='"..toID.."'") local field = "" ..query.. "" mysql:free_result(query) outputDebugString("Mod Package 3 "..field) ----- HERE------ end end ); 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