$insert = "INSERT into books ( id, title, authors, isbn, pages, publisher, publication_date, image_small, image_medium, url_amazon, createdAt) VALUES ( NULL, '" . $hash{$key}{'title'} . "', '" . $hash{$key}{'authors'} . "', '" . $hash{$key}{'isbn'} . "', '" . $hash{$key}{'pages'} . "', '" . $hash{$key}{'publisher'} . "', '" . $hash{$key}{'publication_date'} . "', '" . $hash{$key}{'image_small'} . "', '" . $hash{$key}{'image_medium'} . "', '" . $hash{$key}{'url_amazon'} . "', NULL)"; $sth = $dbh->prepare($insert);