in reply to Duplicity Check Help!
Also, where you say :my $flag_pic = 0;
I think you should take away the quotes and try this please:$flag_pic+="1";
Now if I understand your question correctly you don't want to add any duplicate images into your table and you are checking this based on the value of $flag_pic.$flag_pic+=1;
... so if you have two cases where the if succeeds, $flag_pic will be set to 2, not 1, and if you have three, $flag_pic = 3, and so forth. So in any case where more than one if-statement succeeds in your while loop $flag_pic will NOT EQUAL 1.if ( ($row->{image_name_1} ne "") eq ($pics[0] ne "") ) { $flag_pic += "1"; } if ( ($row->{image_name_2} ne "") eq ($pics[1] ne "") ) { $flag_pic += "1"; } #and all the way to image_name_4
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Duplicity Check Help!
by Anonymous Monk on Dec 02, 2010 at 16:08 UTC | |
by wallisds (Beadle) on Dec 02, 2010 at 16:21 UTC | |
by wallisds (Beadle) on Dec 02, 2010 at 17:05 UTC | |
by Anonymous Monk on Dec 02, 2010 at 16:47 UTC | |
by wallisds (Beadle) on Dec 02, 2010 at 17:26 UTC |