From: Dmitry Nikiforov Date: 2012-02-07T07:19:42+09:00 Subject: MySQL access, parameter binding Hi all! So I have another noob question. In fact - two questions: 1) What's best way to access MySQL? "require 'mysql'"? "require 'dbi'"? I'm confused... DBI doesn't seem to return the number of rows matched by a query (even though sth.rows method is there - it always returns 0). 2) How do I pass an array to bind? For example: bindParams = [ 1, 2 ] sth = dbh.prepare( "select * from table where a = ? and b = ? " ) sth.execute( bindParams ) That's how I, having mostly developed software in Perl, would do it. But apparently that's not how DBI expects it - it does not accept an array, it seems to expect me specifically list all individual values (as in sth.execute( bindParams[0], bindParams[1] ) - what am I missing? Thanks! -- Posted via http://www.ruby-forum.com/.