Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: DB Update w/ Hash

by ferrency (Deacon)
on Sep 05, 2000 at 19:53 UTC ( [id://31132]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    update mytable set ? = 'blah'; # disallowed
    update mytable set myfield = ?; # allowed
    
  2. or download this
    my %user_info;
    
    my $query = "update tUser Set ".
        (join ", " map {"$_ = $user_info{$_}"} keys %user_info).
        " where UserID = $user_info{UserID}";
    
  3. or download this
    # Warning, untested code, to be used for inspiration only
    
    ...
        " where UserID = $user_info{UserID}";
    my $sth = $dbh->prepare($query) or die;
    $sth->execute(map {$user_info{$_}} sort keys %user_info);
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-04-19 10:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found