Jump to content

db. update


Recommended Posts

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 by slapz0r
Link to comment
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

Link to comment
6 minutes ago, keymetaphore said:

dbExec( dbSecurityConnection, ' UPDATE `Test` SET `m9cko`=? ', m9cko )

 

just type instead "2" m9cko and that is all?

What about 

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 by slapz0r
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...