Oh. I'm sorry. I see what you mean. If flag_pic is incremented every time, do me a favor and run this:
if(($row->{image_name_1} ne "") eq ($pics[0] ne "")){
print "IMG NAME is '$image_name_1'\n";
print "PICS-0 is '$pics[0]'\n";
$flag_pic+=1;
}
This will help in troubleshooting because I am not sure what values to expect for these two variables. Right now you are checking to see:
1. if the image name is not equal to '' (empty string)
AND
2. if the pic is not equal to '' (empty string)
Am I correct in my understanding that $pic[x] #(where x is 0-3) will not usually be an empty string because it's the file the user is trying to upload?
Maybe you want to change your if to evaluate against the image name compared to the picture name?
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|