in reply to DBI compare columns problem
Perhaps I misunderstand your code, but you already have the values for mb_award and mb_accept after your initial SELECT. Why do you fetch them again with two more SQL commands?
Your SELECT statements are also insecure if the $form{item} or $fdnum variables are under the control of a user; you should either use ? placeholders or else quote them.
Also, try using the -w switch and use strict, and see if that points you to any errors. And, you don't do any error checking from your various DB calls, so no matter how badly DBI wants to tell you where your error is, it can't.
It's weird to use a string for numeric comparisons. You probably just want if ($mb_award > 0) {.
It's a little weird to assign the array returned from $dbh->fetchrow_array() to a single value. I think it will work, but if the array actually returns more than one thing it may not do what you expect. It would be more idiomatic to say:
($mb_amount_disp) = $dbh->fetchrow_array();
If none of these hints help, you'll need to post some sample rows, what you expect to happen, and what actually happens. The code here certainly does something, but it may not be the same thing you want it to do...
|
|---|