December 2002
Beginner
640 pages
16h 41m
English
After we have run a query and created a resultset, we need to process it. Table 12.2 shows an overview of the DBI methods that we can use to handle the resultset of the query.
| DBI Method | Meaning |
|---|---|
| $hash_ref = $sth->fetchrow_hashref; | Reference to hashed array containing one row of resultset keyed by column name |
| @row_ary = $sth->fetchrow_array; | Array containing one row of resultset |
| $ary_ref = $sth->fetchrow_arrayref; | Reference to object containing one row of resultset |
| $ary_ref = $sth->fetchall_arrayref; | Reference to object containing all rows of resultset |
| $ary_ref = $dbh->selectall_arrayref(); | Prepare and execute query, return reference to object containing all rows of resultset, and finish ... |