fairyoggy Posted July 2, 2019 Posted July 2, 2019 (edited) I have a base. Table with 1 column function save() dbExec( dbSecurityConnection, ' UPDATE `Test` SET `column`=? ', 2 ) outputChatBox( 'Saved', source, 255, 0, 0, true ) end So I update the column to the value "2" How do i do: so that the value is taken from edit1 ? I mean. When i type in edit 1. Example "3" then "3" update value in this column. Edited July 2, 2019 by slapz0r
Addlibs Posted July 3, 2019 Posted July 3, 2019 On the client side: guiGetText triggerServerEvent On the server side: addEvent addEventHandler dbExec 1
fairyoggy Posted July 3, 2019 Author Posted July 3, 2019 6 minutes ago, MrTasty said: On the client side: guiGetText triggerServerEvent On the server side: addEvent addEventHandler dbExec Can you please complete an example of this procedure. I tried to do it myself, but I can't
keymetaphore Posted July 3, 2019 Posted July 3, 2019 1 hour ago, slapz0r said: Can you please complete an example of this procedure. I tried to do it myself, but I can't Show what you tried.
fairyoggy Posted July 3, 2019 Author Posted July 3, 2019 4 minutes ago, keymetaphore said: Show what you tried. --client newEdit = DGS:dgsCreateEdit( 310, 305, 100, 18, "1", false,testernokno ) local m9cko = DGS:dgsGetText(newEdit) --server function savem9cko(m9cko) dbExec( dbSecurityConnection, ' UPDATE `Test` SET `m9cko`=? ', 2 ) outputChatBox( 'saved', source, 255, 0, 0, true ) end addEvent("savem9cko",true) addEventHandler("savem9cko",root,savem9cko) Something like that. And now how to announce "m9cko" (getText) instead "2" in dbExec
keymetaphore Posted July 3, 2019 Posted July 3, 2019 dbExec( dbSecurityConnection, ' UPDATE `Test` SET `m9cko`=? ', m9cko ) 1
fairyoggy Posted July 3, 2019 Author Posted July 3, 2019 (edited) 6 minutes ago, keymetaphore said: dbExec( dbSecurityConnection, ' UPDATE `Test` SET `m9cko`=? ', m9cko ) just type instead "2" m9cko and that is all? What about triggerServerEvent How to use it correctly? in this situation --client addEventHandler("onDgsMouseClick", root, function() if source == test2button then local m9cko = DGS:dgsGetText(newEdit) DGS:dgsSetEnabled(test2button,false) playSoundFrontEnd(1) rr2() triggerServerEvent( "savem9cko", getLocalPlayer()) DGS:dgsSetText(agelabel,m9cko) end end ) Display text from Edit in label - complete but how now to add it to the base instead "2" Edited July 3, 2019 by slapz0r
Addlibs Posted July 3, 2019 Posted July 3, 2019 (edited) triggerServerEvent( "savem9cko", getLocalPlayer(), m9cko) -- line 8 Sends the value of the variable m9cko (which is the text of the editbox) as the 1st parameter of the event savem9cko. Edited July 3, 2019 by MrTasty 1
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