From: Hugh Sasse Date: 2006-10-26T04:20:03+09:00 Subject: Re: ruby mysql errors -where am I going wrong here? On Wed, 25 Oct 2006, Mer Gilmartin wrote: > 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. > > @mytext = 'hi this is a test' I think you'll want : @mytext = '`hi this is a test`' in order that... > #res = dbh.query("INSERT INTO password (user, upassword, temp) > VALUES('check', 'check', #{@mytext})") ... that line becomes correct SQL syntax. > "INSERT INTO password (user, upassword, temp) VALUES('check', > 'check', '#{@mytext}')" > MySQL needs backticks `` for strings. Coming from Unix this was something I didn't expect. > -- > Posted via http://www.ruby-forum.com/. > > Hugh