Re: xml - Mailing list pgsql-novice

From Patrick Hatcher
Subject Re: xml
Date
Msg-id OF44D15CFC.292D2758-ON88256CAE.00608386@fds.com
Whole thread Raw
In response to xml  (Kevin Waterson <kevin@oceania.net>)
List 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@oceania.net>           To:     pgsql-novice@postgresql.org
     
                    Sent by:                      cc:
     
                    pgsql-novice-owner@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





pgsql-novice by date:

Previous
From: Tom Ansley
Date:
Subject: Cascade Updating
Next
From: Hans Deragon
Date:
Subject: Upgrading to RH8.0 causes: "An old version of the database format was found."