I am thinking you mean something like the following...

my @row;
my $sth = $dbh->prepare("SELECT name,phone FROM AddressBook ORDER BY name");
unless($sth->execute())  {
        die "Error: $DBI::errstr\n\n";
}
while(@row = $sth->fetchrow)  {
        print "Name: ".$row[0]." | Phone: ".$row[1]."\n";
}
$sth->finish;
        


========================
Mike Duncan
Web Master/Developer 
Sonopress LLC

828.658.6082  (Desk)
828.423.3310  (Cell)
[EMAIL PROTECTED]
[EMAIL PROTECTED]
========================


-----Original Message-----
From: Brian Warn [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 16, 2001 3:14 PM
To: [EMAIL PROTECTED]
Subject: constructing 2D array


Hi All,

Would someone please advise me regarding the best/easiest way to select two
columns' worth of data and form a two-dimensional array?  I need to do so in
order to be able to use some of the GD module's methods.  I haven't been
able to find answers in documents/archives that I've checked that I thought
would address this.

Thanks,
Brian

Reply via email to