On Thu, Feb 28, 2013 at 7:18 PM, Yu W. <lists / ruby-forum.com> wrote:
> Thanks a lot for reply! I've tried mysql gem. But it doesn't allow
> expression like this
> "(#{(['?'] * keys.size).join(',')})", *values"
>
> it says mysql query method only allows one parameter.

Oh, sorry. It's been a while since I did this, but I believe you have
to call Mysql#prepare on the string containing the '?' placeholders,
which returns a Mysql::Stmt object. Call #execute on that object with
the *values. That's how it works with the Mysql2 gem, anyway; see
http://zetcode.com/db/mysqlrubytutorial/ .