Help for this page

Select Code to Download


  1. 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();
    
  2. 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.
    
  3. or download this
    All over, you are instructing Perl to ignore prototypes. Why do you us
    +e & on your subroutine calls?
    
  4. or download this
    I note a distinct lack of my. Use use strict;!
    
  5. 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;!
    
  6. 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.
    
  7. or download this
    if (@row1 == 6) {
         other code here ...
    };
    
  8. or download this
    for my $row ( 1 .. $#rows ) {
       if (@{ $rows[$row] } == "6") {
    ...
          ...
       }
    }