From: Jano Svitok Date: 2009-07-14T00:24:06+09:00 Subject: Re: MYSQL insert On Mon, Jul 13, 2009 at 17:12, Jeff Bowen wrote: > I'm trying to insert values from a variable into a test MYSQL.  It works > from a fixed value but not if the value is in a variable. > > require 'mysql' > $test = "ABC" > > #db.query('insert into etf_list values ($test)') >    >> in `query': Column 'test' cannot be null (Mysql::Error) use double quotes, and enclose with \"#{}\". single quotes don't expand variables. i.e. db.query(|insert into etf_list values (\"#{$test}\")") j.