Hi all,
thanks for your replies. You have to forgive me; I am very new to perl !! And to add insult to injury, I had stepped away from it for a while ... other projects!
my first post is what I had ended up with after many, many failed attempts. Originally I had.
my ($mb_award,$mb_accept);
$dbh=$db->prepare("SELECT mb_award,mb_accept FROM Items WHERE itemnum=$form{'item'}
AND seller=$fdnum AND
closef='1'");
$dbh->execute();
($mb_award,$mb_accept) = $dbh->fetchrow_array();
my $mb_amount_disp;
if ($mb_award > "0.00") {
$mb_amount_disp = $mb_award;
}
elsif ($mb_accept > "0.00") {
$mb_amount_disp = $mb_accept
I was thinking I was "using up my variable" somewhere ..... so I put the same query in again. it is strange that this is only working for the mb_accept column...
I am using MySql for the database and the default values for the two columns are 0.00 . Entries will be made in the rows mb_accept or mb_award; never both! I need this bit of code to see which row the entry has been made in, and then display the amount. I tried using edoc's snippet ...
if ($mb_award > 0) {
$mb_amount_disp = $mb_award;
} elsif ($mb_accept > 0) {
$mb_amount_disp = $mb_accept;
}
but i still end up with the same result! Nothing... it doesn't even display the default value 0.00
thanks again,
-paul
In reply to Re: (2) Need help with DBI
by Anonymous Monk
in thread DBI compare columns problem
by th3monk3y
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |