Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Update mysql row with a hash

by tstock (Curate)
on Nov 04, 2017 at 03:59 UTC ( #1202738=note: print w/replies, xml ) Need Help??


in reply to Update mysql row with a hash

my ($id) = delete $data_to_insert{id}; my $sql = "UPDATE some_table SET " . join( '=?,', keys %data_to_insert ) . '=? ' . 'WHERE id=?'; $dbh->do( $stmt, undef, values %data_to_insert, $id );

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1202738]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2021-01-27 16:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?