in reply to Re: SQL to XML
in thread SQL to XML

Is the following considered bad practice? Could I just keep adding queries as $recs3, $recs4 etc? Obviously I would amend the XMLout to print to the one output file?
my $dbh = DBI->connect('DBI:mysql:MYDATABASE','user','password') or die DBI->errstr; my $recs = $dbh->selectall_arrayref('SELECT * FROM contents',{ Columns + => {} }); my $resc2 = $dbh->selectall_arrayref('SELECT * FROM contacts',{ Column +s => {} }); # Convert to XML where each hash element becomes an XML element my $xml = XMLout( {contents => $recs contacts => $recs2}, NoAttr => 1 ); print $xml; $dbh->disconnect;