From: botp Date: 2008-10-24T00:46:57+09:00 Subject: Re: Iterating through a database result On Thu, Oct 23, 2008 at 11:15 PM, Daniel Malcolm Webb [dbw] wrote: >... > What I'm currently using is: > num_options = res_qo.to_a.length > puts num_options > puts res_qo.to_a > for i in (1..num_options) > puts res_qo.to_ary[0][1] ^^^^^^^ i think that should be [i][1] > end also, you are reconverting req_qo to array in each loop when in fact you've already created it at the beginning try res_qo.to_a.each do |row| puts row[1] end kind regards -botp