Gossamer Forum
Home : General : Perl Programming :

filling fields from $in

Quote Reply
filling fields from $in
i can't figure out what's wrong here. see the lines below # why doesn't this work. thanks

Code:
%rec = &get_record($in{$db_key});

my (%tmp);

if ($in{'reunion'}) {

foreach $col (@db2_cols) {
if ($in{$col}) { $tmp{$col} = $in{$col}; }
}
$db2_key = $in{'Userid'};
my (%save_in) = %in;
# undef %in; commented because $tmp didn't work
&switch_to_register;


my %rec2 = &get_record2($db2_key);

if ($rec2{'Userid'}) {
# modify record
foreach $col (@db2_cols) {
# if ($tmp{$col}) { $rec2{$col} = $tmp{$col}; } # why doesn't this work
if ($in{$col}) { $rec2{$col} = $in{$col}; } # this works
}
$db2_key = $rec2{'Userid'};
$db2_key_pos = '1';
&modify_record2(%rec2);
}
#####
else {
# add record
$rec2{'Display'} = 'Yes';
$rec2{'Source'} = 'member';
foreach $col (@db2_cols) {
# if ($tmp{$col}) { $rec2{$col} = $tmp{$col}; } # why doesn't this work

if ($in{$col}) { $rec2{$col} = $in{$col}; } # this works
}
$db2_key = $rec2{'Userid'};
$db2_key_pos = '1';
&add_record2(%rec2);

}

%in = %save_in;
}
Subject Author Views Date
Thread filling fields from $in delicia 9177 Oct 24, 2017, 3:22 PM
Thread Re: [delicia] filling fields from $in
Andy 9023 Oct 25, 2017, 2:02 AM
Thread Re: [Andy] filling fields from $in
delicia 9018 Oct 25, 2017, 7:34 AM
Thread Re: [delicia] filling fields from $in
Andy 9005 Oct 25, 2017, 8:21 AM
Thread Re: [Andy] filling fields from $in
delicia 8985 Oct 25, 2017, 12:17 PM
Thread Re: [delicia] filling fields from $in
Andy 8959 Oct 25, 2017, 11:06 PM
Thread Re: [Andy] filling fields from $in
delicia 8917 Oct 26, 2017, 4:55 AM
Thread Re: [delicia] filling fields from $in
Andy 8910 Oct 26, 2017, 5:00 AM
Thread Re: [Andy] filling fields from $in
delicia 8902 Oct 26, 2017, 11:58 AM
Post Re: [delicia] filling fields from $in
Andy 8871 Oct 26, 2017, 10:02 PM
Post Re: [delicia] filling fields from $in
el noe 8942 Oct 26, 2017, 2:17 AM