- or download this
What fetchrow_array returns in scalar context is undocumented.
$data1 = $sth->fetchrow_array();
is wrong. If you want to the first field, use
($data1) = $sth->fetchrow_array();
- or download this
Is the contents of $dberror text of HTML? You put both into it. At wor
+st, this could be an opening for a cross-site scripting attack.
- or download this
All over, you are instructing Perl to ignore prototypes. Why do you us
+e & on your subroutine calls?
- or download this
I note a distinct lack of my. Use use strict;!
- or download this
Something tells me you don't use warnings either. ("if ($data1 ne $dig
+est1)" would warn if fetchrow_array returned zero rows.) Use use warn
+ings;!
- or download this
Why is six in quotes in "if (scalar @row1 == "6")"? You want to compar
+e with the number 6, not the string "6" (which would be converted to
+a number by ==). The scalar is useless too. == creates a scalar conte
+xt, so scalar is redundant.
- or download this
if (@row1 == 6) {
other code here ...
};
- or download this
for my $row ( 1 .. $#rows ) {
if (@{ $rows[$row] } == "6") {
...
...
}
}