Welcome to the Monastery | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I would be interested to see the description of your table 'test_add'.
But in the meantime here are some of my initial suggestions: my $flag_pic; I would define it and turn on warnings (if not already on): use warnings; And for the defining part change my $flag_pic; to Also, where you say : I think you should take away the quotes and try this please: 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. I notice you are saying if ($flag_pic ne "1") { #insert } but you are adding 1 up to 4 times (given the if statements succeed) in your while loop (as shown here so you know what I'm trying to say) ... 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. I recommend changing your if-statement at the bottom to if ($flag_pic == 0) { #insert } See if any of that helps. -Dawn In reply to Re: Duplicity Check Help!
by wallisds
|
|