Help for this page

Select Code to Download


  1. or download this
    my $sth = $dbh->prepare("SELECT * FROM foo");
    $sth->execute();
    
    ...
         # Use @$row like $row->[0], $row->[1], etc.
    }
    $sth->finish();    # Important!
    
  2. or download this
    my $rows = $dbh->selectall_arrayref("SELECT * FROM foo");
    
    # Now @$rows contains all the row data.
    ...
    # Repeat as required, as long as $rows is still defined.
    
    # $sth->finish();  # Update per pope (Not required, no $sth defined)