From: Michael Bevilacqua-Linn Date: 2007-10-17T22:40:26+09:00 Subject: Re: 2 dimensional array ------=_Part_17773_9001686.1192628426288 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Arrays in Ruby don't have a static length, you can append to them at will... irb(main):001:0> anArry = Array.new => [] irb(main):002:0> anArry << Array.new => [[]] irb(main):003:0> anArry << Array.new => [[], []] irb(main):004:0> anArry[0][0] = 1 => 1 irb(main):005:0> anArry => [[1], []] irb(main):006:0> anArry[0][1] = 2 => 2 irb(main):007:0> anArry => [[1, 2], []] irb(main):008:0> anArry[1][0] = 3 => 3 irb(main):009:0> anArry[1][1] = 4 => 4 irb(main):010:0> anArry => [[1, 2], [3, 4]] MBL On 10/17/07, Shuaib Zahda wrote: > > Dear Stefano > Thanks for the reply. The way you gave me is basically makes six rows > and unlimited number of columns > I want the other way aroud > basically I have this table > > field | type | key | default | extra | null > name | string | yes | null | auto_increment| null > id | integer | .... .... . .. . . . . .. > address > > basically is a small database structure > > any idea? thanks > -- > Posted via http://www.ruby-forum.com/. > > ------=_Part_17773_9001686.1192628426288--