Received: from lee.k12.nc.us (shomer.lee.k12.nc.us [207.4.71.118]) by hub.org (8.9.3/8.9.3) with ESMTP id QAA20556 for ; Tue, 22 Jun 1999 16:41:25 -0400 (EDT) (envelope-from joden@lee.k12.nc.us) Received: from lee.k12.nc.us ([10.0.0.1]) by lee.k12.nc.us (8.9.1a/8.9.1) with ESMTP id QAA19921; Tue, 22 Jun 1999 16:34:48 -0400 Message-ID: <376FF3EF.C450B29B@lee.k12.nc.us> Date: Tue, 22 Jun 1999 16:37:04 -0400 From: James Olin Oden Organization: Lee County Schools X-Mailer: Mozilla 4.6 [en] (Win95; U) X-Accept-Language: en MIME-Version: 1.0 To: robert_hiltibidal_at_cms08405@ccmailgw.state.il.us CC: pgsql-interfaces@postgreSQL.org Subject: Re: [INTERFACES] Perl Interface References: <9906229300.AA930077109@ccmailgw.state.il.us> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit robert_hiltibidal_at_cms08405@ccmailgw.state.il.us wrote: > > Afternoon, > > intriguing... however, how do I go to the next row? I tried a > variation earlier that looked like: > > while (@row = $result->fetchrow) { > $string = join("\|",@row); > push(@set,$string); > } > $result = $conn->getResult; > > > I've also tried : > > while ($result = $conn->getResult) { > while (@row = $result->fetchrow) { > $string = join("\|",@row); > } > push(@set,$string); > } > > > The goal is to get multiple rows into a single array. The answer is > probally very simple. > Looks like you caught my "|" error (-; Seriously, I though the following should do it: while (@row = $result->fetchrow) { $string = join("\|",@row); push @set, ($string); } If though you wanted to put them in a multidimensional array (well really a list of references to lists then you would do something like: while (@row = $result->fetchrow) { push @set, (@row); } and then you would reference each element like this: $set[$i][$j] or: $set[$i]->[$j] depending on your mood. ...james