in reply to Best way to deal with quotes in string with DBI

VALUES ( NULL, " . $dbh->quote($hash{$key}{'title'}) . ", " . $dbh->quote($hash{$key}{'authors'}) . ", " . $dbh->quote($hash{$key}{'isbn'}) . ", " . $dbh->quote($hash{$key}{'pages'}) . ", " . $dbh->quote($hash{$key}{'publisher'}) . ", " . $dbh->quote($hash{$key}{'publication_date'}) . ", " . $dbh->quote($hash{$key}{'image_small'}) . ", " . $dbh->quote($hash{$key}{'image_medium'}) . ", " . $dbh->quote($hash{$key}{'url_amazon'}) . ", NULL)";

Replies are listed 'Best First'.
Re^2: Best way to deal with quotes in string with DBI
by Burak (Chaplain) on Jul 28, 2008 at 10:57 UTC
    that code is pretty ugly and unnecessarily complicated. You can use placeholders as suggested before...
      It's not how I would write it, but the OP was having problems with quoting strings.

      It's no more complicated than the original code, and solves the quoting issues using the preferred DBI quoting interface. Placeholders aren't the one and only method of handling quoting issues and it's not my place to tell the OP how to code.