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;
In reply to Re: A more elegant solution?
by Brovnik
in thread A more elegant solution?
by Cirollo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |