Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

RE: DBI inserts and what not

by ncw (Friar)
on Sep 09, 2000 at 02:17 UTC ( [id://31698]=note: print w/replies, xml ) Need Help??


in reply to DBI inserts and what not

As noted above, you call
$dbh->do("update table set thing = ? where id = ?", \%attr, $thing, $id);
What you pass in \%attr is interesting and not particularly obvious, though. Provided you don't want to pass any attributes (I've never needed to) you can pass undef or { } whichever takes your fancy. Eg :-
$dbh->do("update table set thing = ? where id = ?", undef, $thing, $id); # OR $dbh->do("update table set thing = ? where id = ?", {}, $thing, $id);
I usually encapsulate it in a little function though so I can just print out the values of the updates in debug mode!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-24 04:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found