Connect MySQL with XML

How to Connect MySQL with XML?

Questions by pmsudha

Showing Answers 1 - 2 of 2 Answers

hanumanbaba

  • Mar 20th, 2009
 

adoConn.Open("Driver={MySQL ODBC 5.1 Driver};Server=VBNET4;Port=3306; Database=netmusk; User=admin; Password=pass123;Option=3; Min Pool Size=5; Max Pool Size=60; Connect Timeout=2;");

  Was this answer useful?  Yes

hanumanbaba

  • Mar 21st, 2009
 

   use strict;
use DBI;

my $dbh = DBI->connect ("DBI:mysql:test",
"testuser", "testpass",
{ RaiseError => 1, PrintError => 0});
my $sth = $dbh->prepare ("SELECT name, category FROM animal");
$sth->execute ();
print "<?xml version="1.0"?>n";
print "<dataset>n";
while (my ($name, $category) = $sth->fetchrow_array ())
{
print " <row>n";
print " <name>$name</name>n";
print " <category>$category</category>n";
print " </row>n";
}
$dbh->disconnect ();
print "</dataset>n";


  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions