in reply to connection issues to MS SQL Server
use strict; use DBI; my $db="test"; my $host="gmontematorlt.sjcorp.focusframe.com"; my $userid="guest"; my $passwd="password"; my $connectionInfo="dbi:mysql:$db;$host"; # make connection to database my $dbh = DBI->connect($connectionInfo,$userid,$passwd); my $sth = $dbh->prepare ("SELECT name, category FROM animals"); $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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: connection issues to MS SQL Server
by lsxo (Novice) on Aug 07, 2009 at 18:26 UTC | |
by mje (Curate) on Aug 11, 2009 at 09:28 UTC |