From: Valen Date: 2006-05-12T22:36:21+09:00 Subject: Re: Two small questions Daniel Schierbeck wrote: > Valen wrote: >> operator <% list = @connection.query(query) %> raises MYSQL error, so I >> cannot change string "Stuff on shelf" by variable a. I tried different >> ways, but in vain. > > Try this: > > query = "SELECT * FROM `store` WHERE `part`='#{a}'" > > Note the single quotation marks around `#{a}'. Also note that I use > upper case characters for all the SQL keywords -- it's just a > convention, but it makes it easier for others to understand your code if > they're used to the coding style. > > One more thing; is `a' an input you get from the user? If so, you'll > need some more info on how to deal with that. > > > Cheers, > Daniel ---------------------- Thanks a lot, Daniel! I appreciate your help. It works! -- Posted via http://www.ruby-forum.com/.