Perl/SQLite - How do I select / update a row with the prepare method?
- by somebody
I have the following code
my $db = DBI->connect(
"dbi:SQLite:data.db", "", "",
{ RaiseError => 1, AutoCommit => 1, PrintError => 0 }
);
my $row = $db->selectall_arrayref(
"SELECT * FROM something WHERE name=\'$hash->{name}\'");
print Dumper $row;
How do I do the same with my $sql = $db->prepare("......"); $sql->execute($hash->{name}); so that it's escaped correctly and I have the selected data in $row?