hesco has asked for the wisdom of the Perl Monks concerning the following question:
Any ideas would be appreciated.
And from the logs:my $sql = $self->{'cfg'}->param("sql.get_service_plans"); $self->log('The $service_plans query reads: ',$sql); my $sth = $self->{'dbh'}->prepare($sql) or die $self->{'dbh'}->errst +r; $self->log('It\'s $sth looks like this: ',$sth); my $service_plans = $sth->execute() or die $self->{'dbh'}->errstr;; $self->log('The $service_plans query looks like this: ',$service_pla +ns); while (my $plan = $service_plans->fetchrow_hashref()){ print Dumper($plan); }
Thanks,The $service_plans query reads: $VAR1 = 'SELECT svc_plan_id, plan_name, plan_image, plan_description, +plan_deposit, plan_monthly_fee, plan_prepaid_discount, plan_list_size +, plan_group_count FROM svc_plans WHERE plan_active ORDER BY plan_sor +t_order'; It's $sth looks like this: $VAR1 = bless( {}, 'DBI::st' ); The $service_plans query looks like this: $VAR1 = 1; Can't call method "fetchrow_hashref" without a package or object refer +ence at . . .
-- Hugh
UPDATE:
Thanks targetsmart, a second set of eyes got me past that one in a handful of minutes. Your help is appreciated. -- HE
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Stumped by disappearing $sth
by targetsmart (Curate) on May 25, 2009 at 05:01 UTC | |
by hesco (Deacon) on May 25, 2009 at 05:14 UTC |