You are trying to assign $sth as a statement handle, but you can only do that when you prepare the statment first. A prepare call returns a statment handle,execute, then you bind your columns.
Here is the code form bind_columns on the DBI page of CPAN
$dbh->{RaiseError} = 1; # do this, or check every call for errors $sth = $dbh->prepare(q{ SELECT region, sales FROM sales_by_region }) +; $sth->execute; my ($region, $sales); # Bind Perl variables to columns: $rv = $sth->bind_columns(\$region, \$sales); while ($sth->fetch) { print "$region: $sales\n"; }
Notice how they first prepare,then execute,then bind, then fetch. Good luck!
Updated: I confused bind_params and bind_colunms. thanks gmax for pointing out my mistake.
___________In reply to Re: DBI and the hell it has made my life...
by eric256
in thread DBI and the hell it has made my life...
by coyotlgw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |