in reply to DBI compare columns problem
are you useing strict? ie add 'use strict' near the top of your script.
Do some reading on using 'placeholders' in your sql.
Why the extra db selects? You appear to be fetching the same values as you already have.
There's something funky here:
$mb_accept = $dbh=$db->prepare("SELECT ....cleaning it up a bit..
if ($mb_award > 0) { $mb_amount_disp = $mb_award; } elsif ($mb_accept > 0) { $mb_amount_disp = $mb_accept; }
or if you know for certain one and only one of the values will always be > 0
$mb_amount_disp = $mb_award > 0 ? $mb_award : $mb_accept;
But what should happen when neither or both values are > 0 ?
cheers,
J
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (2) Need help with DBI
by Anonymous Monk on Sep 17, 2003 at 05:19 UTC | |
by Roger (Parson) on Sep 17, 2003 at 08:53 UTC | |
by shenme (Priest) on Sep 17, 2003 at 18:08 UTC | |
by hmerrill (Friar) on Sep 17, 2003 at 13:13 UTC | |
by Anonymous Monk on Sep 17, 2003 at 19:25 UTC | |
by th3monk3y (Novice) on Sep 17, 2003 at 22:14 UTC |