Re: xml

From: "Patrick Hatcher" <PHatcher(at)macys(dot)com>
To: "Kevin Waterson <kevin" <kevin(at)oceania(dot)net>
Cc: pgsql-novice(at)postgresql(dot)org, pgsql-novice-owner(at)postgresql(dot)org
Subject: Re: xml
Date: 2003-01-14 17:36:08
Message-ID: OF44D15CFC.292D2758-ON88256CAE.00608386@fds.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


If you using it on a webpage, you could wrap your row data within tags. I
got this from someone on the phpbuilder.com forum and it works great:

echo "<?xml version='1.0' encoding='ISO-8859-1' ?>\n\n";
echo "<dataset>\n";
while(odbc_fetch_row($result))
{
echo "<row>\n";
for ($i = 1; $i <= odbc_num_fields($result); $i++) {
$fname=odbc_field_name($result,$i);
$data=odbc_result($result,$i);

echo "<$fname>$data</$fname>\n";
}
echo "</row>\n";
}
echo "</dataset>\n";

Patrick Hatcher
Macys.Com
Legacy Integration Developer


Kevin Waterson
<kevin(at)oceania(dot)net> To: pgsql-novice(at)postgresql(dot)org
Sent by: cc:
pgsql-novice-owner(at)post Subject: [NOVICE] xml
gresql.org


01/14/2003 03:22 AM

Can I do a SELECT in postgresql and have the output as xml?

Kind regards
Kevin

--
Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
Kevin Waterson
Port Macquarie, Australia

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Browse pgsql-novice by date

  From Date Subject
Next Message Hans Deragon 2003-01-14 23:21:04 Upgrading to RH8.0 causes: "An old version of the database format was found."
Previous Message Tom Ansley 2003-01-14 17:35:27 Cascade Updating