From: Hidetoshi NAGAI Date: 2006-10-26T00:32:52+09:00 Subject: Re: ruby mysql errors -where am I going wrong here? From: Mer Gilmartin Subject: ruby mysql errors -where am I going wrong here? Date: Wed, 25 Oct 2006 23:34:54 +0900 Message-ID: > Here is my test code. I am wondering where I am going wrong. > I get no errors but the [temp] section in the db is still NULL. (snip your code) Hmmm.... Maybe, what you want to do is something like the following. ------------------------------------------------------------- require 'tk' def update_db # DB query # dbh.query("INSERT INTO password (user, upassword, temp) VALUES('check', 'check', #{@mytext})") puts "update DB : @mytext = '#{@mytext}'" end frame = Tk.root @mytext = 'this is a test' userentry = TkEntry.new(frame).pack userentry.value = @mytext ev = TkVirtualEvent.new('Button-1', 'Return') userentry.bind(ev){ if Tk.focus == userentry && @mytext != userentry.value ##??? @mytext = userentry.value update_db end } Tk.mainloop ------------------------------------------------------------- -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)