powerhouse has asked for the wisdom of the Perl Monks concerning the following question:
sub Go_Check_ID { my $id_2_check = shift; my $in_there_already = 0; my $is_completed = 0; my $is_failed = 0; my $is_denied = 0; my $is_pending = 0; my $which_db = ""; if ($is_subscrb) { $which_db = "subscrb"; } else { $which_db = "nonsubscrb"; } my $dbh = MyMODULE::NameConnect(); $sth = $dbh->prepare (qq{ SELECT * FROM $which_db WHERE id = ? }); $sth->execute($id_2_check); $row = $sth->fetchrow_hashref(); $sth->finish(); if ($row && $row->{id} =~ /^$id_2_check$/) { $in_there_already++ if ($row->{payment_status} =~ /^Pending$/i) { # Line 311 $is_pending++; } elsif ($row->{payment_status} =~ /^Failed$/i) { $is_failed++; } elsif ($row->{payment_status} =~ /^Denied$/i) { $is_denied++; } elsif ($row->{payment_status} =~ /^Completed$/i) { $is_completed++; } } if ($in_there_already == 0) { return("JUST_ADD_IT"); } elsif($in_there_already == 1 && $is_completed == 0 && $is_failed + == 0 && $is_denied == 0 && $is_pending == 1) { return("JUST_UPDATE_IT"); } elsif ($in_there_already == 1 && ($is_completed == 1 || $is_fail +ed == 1 || $is_denied == 1)) { return 0; } } # Line 329
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Error in Syntax...
by Coruscate (Sexton) on Feb 09, 2003 at 00:07 UTC | |
by powerhouse (Friar) on Feb 09, 2003 at 05:02 UTC | |
by Coruscate (Sexton) on Feb 09, 2003 at 09:32 UTC | |
by powerhouse (Friar) on Feb 09, 2003 at 14:58 UTC | |
|
Re: Error in Syntax...
by pfaut (Priest) on Feb 09, 2003 at 00:18 UTC | |
by pg (Canon) on Feb 09, 2003 at 00:31 UTC |