On Fri, 29 Dec 2006 14:28:32 -0800, louis fridkis wrote:

Hi Louis

> Thanks for the suggestions. But, wouldn't it just be better to
> switch back to using fetchrow_array()? Is there any advantage to
> using bind_columns in this case?

Sometimes 'better' refers to personal preference rather than a clear-cut matter
of coding convention or style. I'd say suit yourself, unless there is a clear
advantage doing things in one particular way.

This is from my tiny list of DBI best practices:

Use prepare_cached(), and then:

$sth->execute;
my %row;
$sth->bind_columns( \( @row{ @{$sth->{NAME_lc} } } ));
while ($sth->fetch)
{
        print "$row{region}: $row{sales}\n";
}

Actually, I'd like to see a best practices doc alongside the DBI doc, unless
there is already such a doc (and I'm sure I'll get told if there is).

--
Cheers
Ron Savage, [EMAIL PROTECTED] on 30/12/2006
http://savage.net.au/index.html
Let the record show: Microsoft is not an Australian company

Reply via email to