in reply to Hash Tie's DESTROY & DBI
Some error handling might be nice:
Also you might want to consider placeholders, it makes quoting and stuff a lot less error prone:$DBI->do("blah"); if ($DBI->err) { print "Error: ", $DBI->errstr, "\n"; }
Hope this is of some help.foreach (@STRUCTURE) { push @list, "$_ = ?"; push @vals, $impl->{$_}->{value}; } my $string = join ",",@list; $DBH->do(qq{ UPDATE $TABLENAME SET $string WHERE $KEY=? LIMIT 1 }, undef, @vals, $keyval);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Hash Tie's DESTROY & DBI
by tretin (Friar) on Jan 11, 2002 at 05:16 UTC | |
by runrig (Abbot) on Jan 11, 2002 at 05:23 UTC |
In Section
Seekers of Perl Wisdom