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);