in reply to Re: (2) Need help with DBI
in thread DBI compare columns problem
to two steps -($mb_award,$mb_accept) = $dbh->fetchrow_array();
Use the Data::Dumper module to investigate your variables - I suspect you will see an undef in @res (because one of the column might be NULL).use Data::Dumper; ... my @res = $dbh->fetchrow_array(); print Dumper(@res); $mb_award = $res[0]; $mb_accept = $res[1];
if ($mb_award > 0) { $mb_amount_disp = $mb_award; } elsif ($mb_accept > 0) { $mb_amount_disp = $mb_accept; } else { # both values are <= 0 or undef, what shall I do? .... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: (3) DBI compare columns problem
by shenme (Priest) on Sep 17, 2003 at 18:08 UTC |