Thread join & dbh->quote() (15 answers)
Opened by pktm at 2004-03-19 09:00

ptk
 2004-03-19 11:32
#31842 #31842
User since
2003-11-28
3645 Artikel
ModeratorIn
[default_avatar]
Auch in solchen Faellen ist es besser, den Platzhalter-Mechanismus von DBI zu nutzen. Ungefaehr so (ungetesteter Code):
Code: (dl )
1
2
3
4
5
6
my $sql = "INSERT INTO db (";
$sql .= join", ", keys( %{$ref} );
$sql .= ") VALUES (";
$sql .= join", ", map { "?" } values( %{$ref} );
$sql .= ")";
my @bind = values %$ref;

View full thread join & dbh->quote()