in reply to A more elegant solution?
Ought to do it. It is better to call $dbh->quote($hash{$_}) to quote the string value if you have that handle.my $sql = "INSERT INTO $table_name SET "; for (keys %hash) { $sql .= "$_ = '$hash{$_}' ,"; } chop $sql;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: A more elegant solution?
by htoug (Deacon) on Aug 19, 2001 at 19:15 UTC |