I have tried writing this several different ways, but seem to get a different flavor of the same error each time. I'm looking to make it easier for HR to update IT with information they have regarding Employee computers, email changes, logins, etc.
I've checked the mySQL command, and believe I have it correct (and see no errors in my livecode script) but do not seem to be getting anywhere. Any advice would be great! I've put the code below:
Code: Select all
on mouseUp
global gConnectionID
if gConnectionID is not a number then
answer error "Please connect to the database first."
exit to top
end if
put "status" into tTableName
put "email, login, ext, vm, compnum, os, hardware, sftinstalled, update, test" into tFields
/*put field "em" into tEmail
put field "lg" into tLogin
put field "ext" into tExte
put field "vmail" into tVm
put field "compn" into tCompnum
put field "osys" into tOs
put field "hwar" into tHardware
put field "sftin" into tSftinstalled
put field "upd" into tUpdate
put field "tst" into tTest*/
put "UPDATE status SET email='"& field"em"&"', SET login='"& field"lg"&"', SET ext='"& field"exte"&"', SET vm='"& field"vmail"&"', SET compnum='"& field"compn"&"', SET os='"& field"osys"&"', SET hardware='"& field"hwar"&"', SET sftinstalled='"& field"sftin"&"', SET upda='"& field"upda"&"', SET test='"& field"tst"&"' WHERE name='"& selectedtext of field"who9"&"'" into tSQL
revExecuteSQL gConnectionID, tSQL, "tEmail", "tLogin", "tExte", "tVm", "tCompnum", "tOs", "tHardware", "tSftinstalled", "tUpdate", "tTest"
if the result is a number then
answer info "update complete."
else
answer error "There was a problem adding the record to the database:" & cr & the result
end if
end mouseUp
-Sean