Home : Products : Gossamer Links : Discussions :

Products: Gossamer Links: Discussions: Re: [webmaster33] Help - "fetchrow_hashref" problem: Edit Log

Here is the list of edits for this post
Re: [webmaster33] Help - "fetchrow_hashref" problem
Finally I solved my problem, and works fine for me, with the following corrected code:
Code:
sub {
my $db = $DB->table ('Category');
my $sth = $db->select ( ['Full_Name'] );
my ($cat, $row, $name);
while ( $row = $sth->fetchrow_hashref ) {
$name = $row->{Full_Name};
$cat .= "<a href=$name>$name</a><br>";
}
return $cat;
}

mgeyman: as you see the real difference is using:
Code:
while ( $row = $sth->fetchrow_hashref ) {
instead:
Code:
while (my ($row) = $sth->fetchrow_hashref) {
This second one is wrong, it can be only used for arrays.

I hope it helps solving your problem, too.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...

Last edited by:

webmaster33: Feb 24, 2002, 7:35 PM

Edit Log: