http://qs321.pair.com?node_id=183456


in reply to Using Multiple Statements MySQL

You could just save some trips and do:
# get a hash ref keyed to id my $data = $dbh->selectall_hashref( 'select id, name, parent from category', 'id' );
Then you can work out yourself what is the parent of each item.

gav^